fix message and user list core controller setup
This commit is contained in:
@@ -114,15 +114,22 @@ class MessageSearchListCoreState extends State<MessageSearchListCore> {
|
|||||||
if (newMessageSearchBloc != _messageSearchBloc) {
|
if (newMessageSearchBloc != _messageSearchBloc) {
|
||||||
_messageSearchBloc = newMessageSearchBloc;
|
_messageSearchBloc = newMessageSearchBloc;
|
||||||
loadData();
|
loadData();
|
||||||
if (widget.messageSearchListController != null) {
|
|
||||||
widget.messageSearchListController!.loadData = loadData;
|
|
||||||
widget.messageSearchListController!.paginateData = paginateData;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _setupController() {
|
||||||
|
widget.messageSearchListController!.loadData = loadData;
|
||||||
|
widget.messageSearchListController!.paginateData = paginateData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_setupController();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => _buildListView(_messageSearchBloc!);
|
Widget build(BuildContext context) => _buildListView(_messageSearchBloc!);
|
||||||
|
|
||||||
@@ -176,6 +183,11 @@ class MessageSearchListCoreState extends State<MessageSearchListCore> {
|
|||||||
oldWidget.paginationParams?.toJson().toString()) {
|
oldWidget.paginationParams?.toJson().toString()) {
|
||||||
loadData();
|
loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (widget.messageSearchListController !=
|
||||||
|
oldWidget.messageSearchListController) {
|
||||||
|
_setupController();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -128,14 +128,21 @@ class UserListCoreState extends State<UserListCore>
|
|||||||
if (newUsersBloc != _usersBloc) {
|
if (newUsersBloc != _usersBloc) {
|
||||||
_usersBloc = newUsersBloc;
|
_usersBloc = newUsersBloc;
|
||||||
loadData();
|
loadData();
|
||||||
if (widget.userListController != null) {
|
|
||||||
widget.userListController!.loadData = loadData;
|
|
||||||
widget.userListController!.paginateData = paginateData;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_setupController();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _setupController() {
|
||||||
|
widget.userListController!.loadData = loadData;
|
||||||
|
widget.userListController!.paginateData = paginateData;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => _buildListView();
|
Widget build(BuildContext context) => _buildListView();
|
||||||
|
|
||||||
@@ -212,6 +219,10 @@ class UserListCoreState extends State<UserListCore>
|
|||||||
oldWidget.pagination?.toJson().toString()) {
|
oldWidget.pagination?.toJson().toString()) {
|
||||||
loadData();
|
loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (widget.userListController != oldWidget.userListController) {
|
||||||
|
_setupController();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user