fixed bug with 'back' link

This commit is contained in:
Semyon Babushkin
2017-12-11 14:36:11 +03:00
parent b4c0b1d8e4
commit 8c42d040c0
9 changed files with 39 additions and 29 deletions

View File

@@ -136,7 +136,17 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
print(userString);
print(cardPhone);
pushRoute(context, new PurchaseScreen(helper, app, JSON.encode(users[0]), cardPhone));
// pushRoute(context, new PurchaseScreen(helper, app, JSON.encode(users[0]), cardPhone));
var route = new MaterialPageRoute<Null>(
builder: (BuildContext context) =>
new PurchaseScreen(helper, app, JSON.encode(users[0]), cardPhone)
);
while (Navigator.of(context).canPop()) {
Navigator.of(context).pop();
}
Navigator.of(context).pushReplacement(route);
} else {
throw new FlutterError("Users not found");
}