Move logout button to settings. Replace logout button in menu with shutdown button.

This commit is contained in:
Ivan Murashov
2018-02-05 20:02:36 +03:00
parent b19381f00c
commit 5f2d67bbc1
23 changed files with 433 additions and 136 deletions

View File

@@ -45,8 +45,8 @@ logout(BuildContext context, SqliteHelper helper) async {
getDeleteTokenRequest(token).then((response) {
helper.clear().then((result) {
// helper.close().then((_) {
Navigator.of(context).pop();
Navigator.of(context).pop();
// Navigator.of(context).pop();
// Navigator.of(context).pop();
pushRouteReplacement(
context, new SplashScreen()); // Запускаем регистрацию
// });
@@ -93,15 +93,13 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
} else {
String token = await helper.getToken();
// Канал ловит вызовы методов из "нативной" части приложения.
// Могут быть вызваны либо logout либо faq, либо purchase.
// Могут быть вызваны либо exit либо faq, либо purchase.
if (token != null) {
platform.setMethodCallHandler((MethodCall call) async {
print('flutter handler');
print(call.method);
if (call.method == 'logout') {
forceLogout(token, context);
} else if (call.method == 'findUser') {
if (call.method == 'findUser') {
var userResponse;
String cardPhone = call.arguments[0];