Hide discount widgets for crypto flavor

This commit is contained in:
Ivan Murashov
2018-03-09 20:08:28 +03:00
parent 86e3f4ba4c
commit bd1e0ec17f
12 changed files with 95 additions and 73 deletions

View File

@@ -83,7 +83,16 @@ class _SplashScreenState extends BaseState<SplashScreen> {
// В случае, если в приложении отсутствует токен,
// необходимо запустить регистрацию кассы.
if (token == null) {
pushRouteReplacement(context, new RegistrationScreen(helper, app));
new Future.delayed(const Duration(milliseconds: 200), () {
var route = new MaterialPageRoute<bool>(
builder: (BuildContext context) => new RegistrationScreen(helper, app), fullscreenDialog: true);
Navigator.of(context).push(route).then((b) {
_initAndStartScanner(context, app, token, helper);
});
});
// pushRoute(context, new RegistrationScreen(helper, app));
} else {
if (await platform.invokeMethod('isOnline')) {
getCheckTokenStatusRequest(token).then((statusResponse) {
@@ -100,7 +109,6 @@ class _SplashScreenState extends BaseState<SplashScreen> {
/// Если токен не активен, попробовать создать его еще раз.
handleStatusResponse(var statusResponse, SqliteHelper helper) async {
int code = statusResponse.statusCode;
if (code == 404) {
helper.clear().then((result) {
pushRouteReplacement(context, new RegistrationScreen(helper, app));
@@ -191,7 +199,14 @@ class _SplashScreenState extends BaseState<SplashScreen> {
} else if (call.method == 'faq') {
faq(helper, app, context, true);
} else if (call.method == 'settings') {
pushRoute(context, new SettingsScreen(helper, app, true));
new Future.delayed(const Duration(milliseconds: 200), () {
var route = new MaterialPageRoute<bool>(
builder: (BuildContext context) => new SettingsScreen(helper, app, true), fullscreenDialog: true);
Navigator.of(context).push(route).then((b) {
print('purchase closed: $b');
_initAndStartScanner(context, app, token, helper);
});
});
} else {
String userString;
@@ -254,5 +269,4 @@ class _SplashScreenState extends BaseState<SplashScreen> {
return null;
}
}
}
}