Fixes on adnroid and ios
This commit is contained in:
@@ -87,13 +87,6 @@ class FAQScreenState<T> extends BaseState<FAQScreen> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
initPhoneAndUrl().then((_) {
|
||||
super.initState();
|
||||
});
|
||||
}
|
||||
|
||||
@override Widget build(BuildContext context) {
|
||||
return new Scaffold(appBar: getAppBar(), body: getScreenContent());
|
||||
}
|
||||
@@ -104,12 +97,14 @@ class FAQScreenState<T> extends BaseState<FAQScreen> {
|
||||
}
|
||||
|
||||
void initHelp(String phone, String url) {
|
||||
data = <Entry>[
|
||||
new Entry(StringsLocalization.registration(), StringsLocalization.registrationGuide()),
|
||||
new Entry(StringsLocalization.usage(), StringsLocalization.usageGuide()),
|
||||
new Entry(StringsLocalization.support(), StringsLocalization.supportGuide(phone, url)),
|
||||
new Entry(StringsLocalization.common(), StringsLocalization.commonGuide())
|
||||
];
|
||||
setState(() {
|
||||
data = <Entry>[
|
||||
new Entry(StringsLocalization.registration(), StringsLocalization.registrationGuide()),
|
||||
new Entry(StringsLocalization.usage(), StringsLocalization.usageGuide()),
|
||||
new Entry(StringsLocalization.support(), StringsLocalization.supportGuide(phone, url)),
|
||||
new Entry(StringsLocalization.common(), StringsLocalization.commonGuide())
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
@override List<Widget> getMenuButtons() {
|
||||
@@ -119,6 +114,7 @@ class FAQScreenState<T> extends BaseState<FAQScreen> {
|
||||
/// Метод возвращает ListView с блоками faq.
|
||||
@override Widget getScreenContent() {
|
||||
if (data == null) {
|
||||
initPhoneAndUrl();
|
||||
return getBackground();
|
||||
} else {
|
||||
return new ListView.builder(
|
||||
|
||||
@@ -62,7 +62,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
String loyalityType = '';
|
||||
String loyalty = '';
|
||||
String bonus = '';
|
||||
List<Map> coupons = [];
|
||||
List<dynamic> coupons = [];
|
||||
ListView listView;
|
||||
|
||||
@override
|
||||
@@ -388,7 +388,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
setState(() {
|
||||
loading = false;
|
||||
});
|
||||
List<String> errors = purchase['errors'];
|
||||
List<dynamic> errors = purchase['errors'];
|
||||
purchaseInProgress = false;
|
||||
apiErrorAlert(errors[0]);
|
||||
} else {
|
||||
@@ -424,7 +424,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
}
|
||||
|
||||
void setBonuses(Map bonuses, bool showBonus) {
|
||||
print('kifio ' + this.loyalityType);
|
||||
print('loyalityType ' + this.loyalityType);
|
||||
if (bonuses['type'] == 'amount') {
|
||||
this.loyalty = '${user['discount']}%';
|
||||
} else {
|
||||
@@ -436,7 +436,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
if (showBonus && (this.loyalityType == 'bonus')) {
|
||||
this.bonus = '${user['bonus']}';
|
||||
}
|
||||
print('kifio ' + this.loyalty);
|
||||
print('loyalty ' + this.loyalty);
|
||||
print('bonus ' + this.bonus);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class PurchaseSuccessScreen extends StatefulWidget {
|
||||
final String app;
|
||||
final SqliteHelper helper;
|
||||
final Map details;
|
||||
final List<Map> coupons;
|
||||
final List<dynamic> coupons;
|
||||
|
||||
@override State createState() =>
|
||||
new PurchaseSuccessScreenState(val, name, helper, app, details, coupons);
|
||||
@@ -25,7 +25,7 @@ class PurchaseSuccessScreenState<T> extends BaseState<PurchaseSuccessScreen> {
|
||||
|
||||
PurchaseSuccessScreenState(
|
||||
String sum, String username, SqliteHelper helper,
|
||||
String app, Map details, List<Map> coupons
|
||||
String app, Map details, List<dynamic> coupons
|
||||
) : super(helper, app) {
|
||||
this.sum = sum;
|
||||
this.username = username;
|
||||
@@ -35,7 +35,7 @@ class PurchaseSuccessScreenState<T> extends BaseState<PurchaseSuccessScreen> {
|
||||
|
||||
String sum, username;
|
||||
Map details;
|
||||
List<Map> coupons;
|
||||
List<dynamic> coupons;
|
||||
int bonusPlus = 0;
|
||||
int bonusMinus = 0;
|
||||
int currency;
|
||||
@@ -56,8 +56,10 @@ class PurchaseSuccessScreenState<T> extends BaseState<PurchaseSuccessScreen> {
|
||||
void initState() {
|
||||
helper.getCurrency().then((currency) {
|
||||
helper.getToken().then((token) {
|
||||
this.currency = currency;
|
||||
this.token = token;
|
||||
setState(() {
|
||||
this.currency = currency;
|
||||
this.token = token;
|
||||
});
|
||||
});
|
||||
});
|
||||
super.initState();
|
||||
|
||||
@@ -201,7 +201,7 @@ class _SplashScreenState extends BaseState<SplashScreen> {
|
||||
|
||||
if (userResponse != null) {
|
||||
print('I have user in method handler!');
|
||||
List<Map> users = JSON.decode(userResponse.body);
|
||||
List<dynamic> users = JSON.decode(userResponse.body);
|
||||
if (users.length > 0) {
|
||||
return users[0];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user