Refactor SpaceManagementPage's initState to ensure HTTPService is initialized before use in CommunitiesBloc.

This commit is contained in:
Faris Armoush
2025-07-21 16:24:11 +03:00
parent ce65b068ff
commit 35c8a73156

View File

@ -31,12 +31,12 @@ class _SpaceManagementPageState extends State<SpaceManagementPage> {
@override @override
void initState() { void initState() {
_httpService = HTTPService();
communitiesBloc = CommunitiesBloc( communitiesBloc = CommunitiesBloc(
communitiesService: DebouncedCommunitiesService( communitiesService: DebouncedCommunitiesService(
RemoteCommunitiesService(_httpService), RemoteCommunitiesService(_httpService),
), ),
)..add(const LoadCommunities(LoadCommunitiesParam())); )..add(const LoadCommunities(LoadCommunitiesParam()));
_httpService = HTTPService();
super.initState(); super.initState();
} }