Fixes on adnroid and ios

This commit is contained in:
Ivan Murashov
2018-05-21 23:59:29 +03:00
parent beb3732b63
commit 41fd167ab6
11 changed files with 46 additions and 25 deletions

View File

@@ -67,7 +67,7 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> {
List<Widget> getMenuButtons() {
List<Widget> menuItemList = [];
List<PopupMenuEntry<int>> menuItemList = [];
menuItemList.add(new PopupMenuItem(
value: 0,
child: getMenuItem(settings_png, StringsLocalization.settings())

View File

@@ -53,7 +53,7 @@ class SqliteHelper {
/// необходимые для идентификации пользователя и проведения запросов.
Future createSession(String merchantID, String posID, String token) async {
Map session = {
Map<String, dynamic> session = {
columnMerchantID: merchantID,
columnPosID: posID,
columnToken: token,

View File

@@ -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(

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -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 {