Выпадающее меню с тремя кнопками
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import 'db.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:checker/screens/faq.dart';
|
||||
import 'package:checker/screens/purchase.dart';
|
||||
import 'package:checker/screens/registration.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'consts.dart';
|
||||
import 'db.dart';
|
||||
import 'network.dart';
|
||||
import 'resources.dart';
|
||||
import 'package:checker/registration.dart';
|
||||
import 'package:checker/purchase.dart';
|
||||
import 'faq.dart';
|
||||
import 'strings.dart';
|
||||
|
||||
// Канал для взаимодействия с кодом платформы.
|
||||
@@ -53,13 +53,18 @@ logout(BuildContext context) async {
|
||||
showYesNoDialog(context, StringsLocalization.confirmation(), StringsLocalization.askChangeStore(), positiveCalback);
|
||||
}
|
||||
|
||||
forceLogout(SqliteHelper helper, BuildContext context) async {
|
||||
String token = await helper.getToken();
|
||||
forceLogout(String token , BuildContext context) async {
|
||||
|
||||
deleteToken(token).then((response) {
|
||||
print(response.body);
|
||||
platform.invokeMethod('removeKeys').then((result) {
|
||||
Navigator.of(context).pop();
|
||||
pushRoute(context, new RegistrationScreen()); // Запускаем регистрацию
|
||||
SqliteHelper helper = new SqliteHelper();
|
||||
helper.open().then((_) {
|
||||
helper.clear().then((_) {
|
||||
helper.close().then((_) {
|
||||
Navigator.of(context).pop();
|
||||
pushRoute(context, new RegistrationScreen()); // Запускаем регистрацию
|
||||
});
|
||||
});
|
||||
});
|
||||
}).catchError((error) {
|
||||
print(error.toString());
|
||||
@@ -79,7 +84,7 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
|
||||
print('call.method: ${call.method}');
|
||||
if (call.method == 'logout') {
|
||||
forceLogout(helper, context);
|
||||
forceLogout(token, context);
|
||||
} else if (call.method == 'faq') {
|
||||
faq(context, true);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user