Название приложения в шапке не null, необходимо проверить исправление падений при возвращении на экран сканнера с экрана настроек
This commit is contained in:
@@ -86,7 +86,6 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
});
|
||||
} else {
|
||||
String token = await helper.getToken();
|
||||
helper.close();
|
||||
// Канал ловит вызовы методов из "нативной" части приложения.
|
||||
// Могут быть вызваны либо logout либо faq, либо purchase.
|
||||
if (token != null) {
|
||||
@@ -96,10 +95,14 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
} else if (call.method == 'faq') {
|
||||
faq(context, true);
|
||||
} else if(call.method == 'settings') {
|
||||
helper = new SqliteHelper();
|
||||
helper.open().then((_) {
|
||||
if (helper == null) {
|
||||
helper = new SqliteHelper();
|
||||
helper.open().then((_) {
|
||||
pushRoute(context, new SettingsScreen(helper, app, true));
|
||||
});
|
||||
} else {
|
||||
pushRoute(context, new SettingsScreen(helper, app, true));
|
||||
});
|
||||
}
|
||||
} else {
|
||||
String userString = call.arguments[0];
|
||||
String card = call.arguments[1];
|
||||
@@ -114,20 +117,22 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async {
|
||||
}
|
||||
});
|
||||
|
||||
platform.invokeMethod('getEndpoint').then((endpoint) {
|
||||
platform.invokeMethod('getAppToken').then((appToken) async {
|
||||
platform.invokeMethod('startScanner', {
|
||||
'token': token,
|
||||
'url': endpoint,
|
||||
'appToken': appToken,
|
||||
'locale': Intl.defaultLocale,
|
||||
'color': Resources
|
||||
.getPrimaryColor(app)
|
||||
.value
|
||||
helper.close().then((_){
|
||||
helper = null;
|
||||
platform.invokeMethod('getEndpoint').then((endpoint) {
|
||||
platform.invokeMethod('getAppToken').then((appToken) async {
|
||||
platform.invokeMethod('startScanner', {
|
||||
'token': token,
|
||||
'url': endpoint,
|
||||
'appToken': appToken,
|
||||
'locale': Intl.defaultLocale,
|
||||
'color': Resources
|
||||
.getPrimaryColor(app)
|
||||
.value
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
const String appName = "Autobonus";
|
||||
|
||||
// Assets
|
||||
const String logout_png = 'assets/logout.png';
|
||||
const String help_png = 'assets/help.png';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:checker/screens/splash.dart';
|
||||
import 'package:checker/consts.dart';
|
||||
|
||||
/// Точка входа в приложение.
|
||||
void main() {
|
||||
@@ -9,6 +10,8 @@ void main() {
|
||||
class Checker extends StatelessWidget {
|
||||
|
||||
@override Widget build(BuildContext context) {
|
||||
return new MaterialApp(home: new SplashScreen());
|
||||
return new MaterialApp(
|
||||
title: appName,
|
||||
home: new SplashScreen());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user