На экране проведения покупки правильно обрабатывается сумма покупки, передается на экран подтверждения
This commit is contained in:
@@ -33,8 +33,13 @@ const Color tokenActiveTextColor = const Color(0xff1f5a1f);
|
||||
const Color tokenActivateTextColor = const Color(0xff4e3a19);
|
||||
const Color greenBackground = const Color(0xff8ae28a);
|
||||
|
||||
// Margins
|
||||
// Dimens
|
||||
const double verticalMargin = 28.0;
|
||||
const double buttonVerticalMargin = 64.0;
|
||||
const double buttonHeight = 48.0;
|
||||
const double iconHeight = 20.0;
|
||||
|
||||
const platform = const MethodChannel('com.dinect.checker/instance_id');
|
||||
|
||||
// HttpClient
|
||||
final httpClient = createHttpClient();
|
||||
@@ -56,14 +61,12 @@ checkToken(BuildContext context) async {
|
||||
/// Может производиться с нескольких экранов (splash, finish_registration).
|
||||
startScanner(BuildContext context) async {
|
||||
|
||||
const platform = const MethodChannel('com.dinect.checker/instance_id');
|
||||
|
||||
// Канал слушает ловит вызовы методов из "нативной" части приложения.
|
||||
// Могут быть вызваны либо logaut либо faq, либо purchase.
|
||||
platform.setMethodCallHandler((MethodCall call) async {
|
||||
|
||||
if (call.method == 'foo') {
|
||||
logout();
|
||||
logout(context);
|
||||
} else {
|
||||
pushRoute(context, new PurchaseScreen());
|
||||
}
|
||||
@@ -71,22 +74,24 @@ startScanner(BuildContext context) async {
|
||||
return result;
|
||||
|
||||
});
|
||||
|
||||
|
||||
Navigator.of(context).pop();
|
||||
await platform.invokeMethod('startScanner');
|
||||
}
|
||||
|
||||
logout(BuildContext context) {
|
||||
|
||||
// String url = intUrl + 'tokens/' + token + '?_dmapptoken=' + intToken;
|
||||
String url = intUrl + 'tokens/' + 'khooi' + '?_dmapptoken=' + intToken;
|
||||
print(url);
|
||||
httpClient.delete(url).then((response) {
|
||||
print(response.body);
|
||||
const platform = const MethodChannel('com.dinect.checker/instance_id');
|
||||
platform.invokeMethod('removeKeys');
|
||||
pushRoute(context, new RegistrationScreen());
|
||||
}).catchError((error) {
|
||||
print(error.toString());
|
||||
});
|
||||
|
||||
// httpClient.delete(url).then((response) {
|
||||
// print(response.body);
|
||||
// }).catchError((error) {
|
||||
// print(error.toString());
|
||||
// });
|
||||
|
||||
pushRoute(context, new RegistrationScreen());
|
||||
}
|
||||
|
||||
/// Навигация по приложению.
|
||||
|
||||
Reference in New Issue
Block a user