Upgrade to support new version
This commit is contained in:
@@ -77,7 +77,7 @@ class RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
|
|||||||
helper.getToken().then((token) {
|
helper.getToken().then((token) {
|
||||||
getCheckTokenStatusRequest(token).then((response) {
|
getCheckTokenStatusRequest(token).then((response) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_tokenActive = JSON.decode(response.body)['active'];
|
_tokenActive = json.decode(response.body)['active'];
|
||||||
});
|
});
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
print(error.toString());
|
print(error.toString());
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
|||||||
bool isAutomaticallyImplyLeading() => false;
|
bool isAutomaticallyImplyLeading() => false;
|
||||||
|
|
||||||
PurchaseScreenState(SqliteHelper helper, String app, String userString, String card) : super(helper, app) {
|
PurchaseScreenState(SqliteHelper helper, String app, String userString, String card) : super(helper, app) {
|
||||||
this.user = JSON.decode(userString);
|
this.user = json.decode(userString);
|
||||||
this.card = card;
|
this.card = card;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,8 +239,8 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
|||||||
} catch(error) {
|
} catch(error) {
|
||||||
print(error.toString());
|
print(error.toString());
|
||||||
}
|
}
|
||||||
Map loyality = JSON.decode(response.body);
|
Map loyality = json.decode(response.body);
|
||||||
Map coupons = JSON.decode(couponResponse.body);
|
Map coupons = json.decode(couponResponse.body);
|
||||||
|
|
||||||
coupons['results'].forEach((couponItem) {
|
coupons['results'].forEach((couponItem) {
|
||||||
couponItem['isSet'] = false;
|
couponItem['isSet'] = false;
|
||||||
@@ -378,7 +378,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
purchaseResponse = await getPurchaseRequest(user['purchases_url'], body, token);
|
purchaseResponse = await getPurchaseRequest(user['purchases_url'], body, token);
|
||||||
purchase = JSON.decode(purchaseResponse.body);
|
purchase = json.decode(purchaseResponse.body);
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
purchaseInProgress = false;
|
purchaseInProgress = false;
|
||||||
print(error.toString());
|
print(error.toString());
|
||||||
@@ -402,7 +402,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
|||||||
print(error.toString());
|
print(error.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
Map coupons = JSON.decode(couponsResponse.body);
|
Map coupons = json.decode(couponsResponse.body);
|
||||||
|
|
||||||
new Future.delayed(const Duration(milliseconds: 200), () {
|
new Future.delayed(const Duration(milliseconds: 200), () {
|
||||||
print('show purchase success!');
|
print('show purchase success!');
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class RegistrationScreenState extends BaseState<RegistrationScreen> {
|
|||||||
|
|
||||||
print(response.body);
|
print(response.body);
|
||||||
print(response.statusCode.toString());
|
print(response.statusCode.toString());
|
||||||
Map parsedMap = JSON.decode(response.body);
|
Map parsedMap = json.decode(response.body);
|
||||||
|
|
||||||
if (response.statusCode == 201) {
|
if (response.statusCode == 201) {
|
||||||
helper.createSession(merchantID, posID, parsedMap['token']).then((_) {
|
helper.createSession(merchantID, posID, parsedMap['token']).then((_) {
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ class _SplashScreenState extends BaseState<SplashScreen> {
|
|||||||
showNextScreen(new RegistrationScreen(helper, app));
|
showNextScreen(new RegistrationScreen(helper, app));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Map status = JSON.decode(statusResponse.body);
|
Map status = json.decode(statusResponse.body);
|
||||||
bool active = status['active'] == null ? false : status['active'];
|
bool active = status['active'] == null ? false : status['active'];
|
||||||
|
|
||||||
if (active) {
|
if (active) {
|
||||||
@@ -161,7 +161,7 @@ class _SplashScreenState extends BaseState<SplashScreen> {
|
|||||||
/// Очищаем бд, делаем запрос на удаление токена.
|
/// Очищаем бд, делаем запрос на удаление токена.
|
||||||
Future clearToken(Response response, SqliteHelper helper) async {
|
Future clearToken(Response response, SqliteHelper helper) async {
|
||||||
helper.clear().then((_) {
|
helper.clear().then((_) {
|
||||||
Map parsedMap = JSON.decode(response.body);
|
Map parsedMap = json.decode(response.body);
|
||||||
getDeleteTokenRequest(parsedMap['token']).then((_) {
|
getDeleteTokenRequest(parsedMap['token']).then((_) {
|
||||||
showNextScreen(new RegistrationScreen(helper, app));
|
showNextScreen(new RegistrationScreen(helper, app));
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
@@ -201,7 +201,7 @@ class _SplashScreenState extends BaseState<SplashScreen> {
|
|||||||
|
|
||||||
if (userResponse != null) {
|
if (userResponse != null) {
|
||||||
print('I have user in method handler!');
|
print('I have user in method handler!');
|
||||||
List<dynamic> users = JSON.decode(userResponse.body);
|
List<dynamic> users = json.decode(userResponse.body);
|
||||||
if (users.length > 0) {
|
if (users.length > 0) {
|
||||||
return users[0];
|
return users[0];
|
||||||
} else {
|
} else {
|
||||||
@@ -238,7 +238,7 @@ class _SplashScreenState extends BaseState<SplashScreen> {
|
|||||||
} else {
|
} else {
|
||||||
String userString = call.arguments[0] is String
|
String userString = call.arguments[0] is String
|
||||||
? call.arguments[0]
|
? call.arguments[0]
|
||||||
: JSON.encode(call.arguments[0]);
|
: json.encode(call.arguments[0]);
|
||||||
print(userString);
|
print(userString);
|
||||||
String card = call.arguments[1];
|
String card = call.arguments[1];
|
||||||
showNextScreen(new PurchaseScreen(helper, app, userString, card));
|
showNextScreen(new PurchaseScreen(helper, app, userString, card));
|
||||||
|
|||||||
50
pubspec.lock
50
pubspec.lock
@@ -7,21 +7,21 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.7"
|
version: "2.0.8"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.2"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.14.6"
|
version: "1.14.11"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -33,14 +33,14 @@ packages:
|
|||||||
name: http
|
name: http
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.11.3+16"
|
version: "0.12.0"
|
||||||
http_parser:
|
http_parser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: http_parser
|
name: http_parser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.2"
|
version: "3.1.3"
|
||||||
image_picker:
|
image_picker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -48,41 +48,34 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.2"
|
version: "0.4.2"
|
||||||
matcher:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: matcher
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.12.2+1"
|
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.5"
|
version: "1.1.6"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.5.1"
|
version: "1.6.2"
|
||||||
path_provider:
|
path_provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: path_provider
|
name: path_provider
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.2"
|
version: "0.4.1"
|
||||||
petitparser:
|
petitparser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: petitparser
|
name: petitparser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.6"
|
version: "2.0.2"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -94,63 +87,56 @@ packages:
|
|||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.0"
|
version: "1.4.1"
|
||||||
sprintf:
|
sprintf:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: sprintf
|
name: sprintf
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.2"
|
version: "4.0.0"
|
||||||
sqflite:
|
sqflite:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: sqflite
|
name: sqflite
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.8.9"
|
version: "0.12.2+1"
|
||||||
stack_trace:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: stack_trace
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "1.9.2"
|
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.4"
|
||||||
synchronized:
|
synchronized:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: synchronized
|
name: synchronized
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.0"
|
version: "1.5.3"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: typed_data
|
name: typed_data
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.5"
|
version: "1.1.6"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.6"
|
version: "2.0.8"
|
||||||
xml:
|
xml:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: xml
|
name: xml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.2.3"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.0.0-dev.35 <=2.0.0-dev.55.0.flutter-97b6c2e09d"
|
dart: ">=2.0.0 <3.0.0"
|
||||||
flutter: ">=0.1.4 <2.0.0"
|
flutter: ">=0.1.4 <2.0.0"
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ description: A new Flutter project.
|
|||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
http: '>=0.11.3+12'
|
http: '>=0.11.3+12'
|
||||||
sprintf: "^3.0.2"
|
sprintf: "4.0.0"
|
||||||
path_provider: "^0.2.1+1"
|
path_provider: "0.4.1"
|
||||||
sqflite: any
|
sqflite: "0.12.2+1"
|
||||||
image_picker: '^0.4.1' # use for ask permissions @ iOS
|
image_picker: '^0.4.1' # use for ask permissions @ iOS
|
||||||
xml: "^3.0.0"
|
xml: "^3.0.0"
|
||||||
flutter:
|
flutter:
|
||||||
|
|||||||
Reference in New Issue
Block a user