I have two pages one is list view and another is form kind of page. Using sqflite with streambuilder for crud operation, Once i enter input and save from second screen list view from screen one should be updated.
First Screen:
List view will be return from sqflite datatbase like this.
Widget getDebtorsWidget() {
return StreamBuilder(
stream: debtorBloc.debtors,
builder: (BuildContext context, AsyncSnapshot<List<Debtor>> snapshot) {
return getDebtorCardWidget(snapshot);
},
);
}
-----------------------------------------------------------------------------
floatingActionButton: FloatingActionButton(
tooltip: 'Add an entry',
child: Icon(Icons.add),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => DebtorFormFullScreenDialog(),
fullscreenDialog: true,
));
//_showAddDebtorSheet(context);
},
),
void _showAddDebtorSheet(BuildContext context) {
......
}
Second screen:
onPressed: () {
final newDebtor =
Debtor(name: _debtorNameFormController.value.text);
if (newDebtor.name.isNotEmpty) {
debtorBloc.addDebtor(newDebtor);
//dismisses the bottomsheet
Navigator.pop(context, false);
}
},
_showAddDebtorSheet() is on same screen when enter data with in this listview updates immediately. But when when do it on second screen is not listview not updates even when i navigate back to first screen.
Note: Pls notify me if you need extra information.