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:
parent
87cc42a1c7
commit
e9f69fa327
1 changed files with 3 additions and 13 deletions
|
@ -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>[];
|
||||
|
||||
|
|
Loading…
Reference in a new issue