1
0
Fork 0
mirror of https://gitlab.com/nkming2/nc-photos.git synced 2025-03-14 11:18:54 +01:00

Use private bloc for people

This commit is contained in:
Ming Ming 2021-09-10 01:35:42 +08:00
parent 87cc42a1c7
commit e9f69fa327

View file

@ -76,18 +76,8 @@ class _PeopleBrowserState extends State<PeopleBrowser> {
}
void _initBloc() {
_bloc = ListPersonBloc.of(widget.account);
if (_bloc.state is ListPersonBlocInit) {
_log.info("[_initBloc] Initialize bloc");
_reqQuery();
} else {
// process the current state
WidgetsBinding.instance!.addPostFrameCallback((_) {
setState(() {
_onStateChange(context, _bloc.state);
});
});
}
}
Widget _buildContent(BuildContext context, ListPersonBlocState state) {
@ -218,7 +208,7 @@ class _PeopleBrowserState extends State<PeopleBrowser> {
_bloc.add(ListPersonBlocQuery(widget.account));
}
late ListPersonBloc _bloc;
final _bloc = ListPersonBloc();
var _items = <_ListItem>[];