Поправил отзывчивость кнопок валют на экране валюты, исправил отображение названий валюты на экранах проведения покупки (рубль, рубля, рублей) для русской локали
This commit is contained in:
@@ -1,28 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'dart:convert'; // Пакет для обработки json с ответом от сервера.
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:checker/base/base_screen.dart';
|
||||
import 'package:checker/base/base_state.dart';
|
||||
import 'package:checker/common.dart';
|
||||
import 'package:checker/consts.dart';
|
||||
import 'package:checker/db.dart';
|
||||
import 'package:checker/network.dart';
|
||||
import 'package:checker/base/base_state.dart';
|
||||
import 'package:checker/strings.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class FinishRegistrationScreen extends StatefulWidget {
|
||||
@override State createState() => new _RegistrationScreenState();
|
||||
class FinishRegistrationScreen extends BaseScreen {
|
||||
|
||||
FinishRegistrationScreen(helper, app) : super(helper, app);
|
||||
|
||||
@override State createState() => new RegistrationScreenState(helper, app);
|
||||
}
|
||||
|
||||
class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
|
||||
class RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
|
||||
|
||||
RegistrationScreenState(SqliteHelper helper, String app) {
|
||||
this.helper = helper;
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
bool _tokenActive = false;
|
||||
String _merchantID;
|
||||
String _merchantID = '';
|
||||
|
||||
@override void onStart() {
|
||||
helper.getMerchantID().then((result) {
|
||||
setState(() {
|
||||
_merchantID = result;
|
||||
@override Widget build(BuildContext context) {
|
||||
if (_merchantID == '') {
|
||||
helper.getMerchantID().then((result) {
|
||||
setState(() {
|
||||
_merchantID = result;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
return getMainWidget();
|
||||
}
|
||||
|
||||
@override String getTitle() {
|
||||
@@ -54,7 +67,6 @@ class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
|
||||
if (await platform.invokeMethod('isOnline')) {
|
||||
String token = await helper.getToken();
|
||||
checkTokenStatus(token).then((response) {
|
||||
|
||||
print(response.body);
|
||||
Map parsedMap = JSON.decode(response.body);
|
||||
|
||||
@@ -72,23 +84,29 @@ class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
|
||||
}
|
||||
|
||||
@override getTextWidget() {
|
||||
return new Row(children: <Widget>[new Text(_merchantID != null ? _merchantID : '',
|
||||
style: new TextStyle(color: Colors.black, fontSize: 16.0))]);
|
||||
return new Row(
|
||||
children: <Widget>[new Text(_merchantID != null ? _merchantID : '',
|
||||
style: new TextStyle(color: Colors.black, fontSize: 16.0))
|
||||
]);
|
||||
}
|
||||
|
||||
/// Метод возвращает контейнер с текстом сообщения и бэкграундом.
|
||||
getMessage() {
|
||||
return new Container(height: _tokenActive ? 72.0 : 108.0, decoration: _getDecorationForMessageField(),
|
||||
margin: new EdgeInsets.only(top: 20.0, left: 12.0, right: 12.0),
|
||||
padding: new EdgeInsets.only(bottom: 22.0, left: 14.0, right: 14.0),
|
||||
child: new Center(child: getMessageTextWidget()));
|
||||
return new Container(height: _tokenActive ? 72.0 : 108.0,
|
||||
decoration: _getDecorationForMessageField(),
|
||||
margin: new EdgeInsets.only(top: 20.0, left: 12.0, right: 12.0),
|
||||
padding: new EdgeInsets.only(bottom: 22.0, left: 14.0, right: 14.0),
|
||||
child: new Center(child: getMessageTextWidget()));
|
||||
}
|
||||
|
||||
/// Метод возвращает виджет с текстом сообщения, всеми его привязками и стилями.
|
||||
getMessageTextWidget() {
|
||||
return new Text(getMessageString(), textAlign: TextAlign.center,
|
||||
style: new TextStyle(height: 1.5, fontWeight: FontWeight.bold, fontSize: 14.0,
|
||||
color: _tokenActive ? tokenActiveTextColor : tokenActivateTextColor));
|
||||
style: new TextStyle(
|
||||
height: 1.5, fontWeight: FontWeight.bold, fontSize: 14.0,
|
||||
color: _tokenActive
|
||||
? tokenActiveTextColor
|
||||
: tokenActivateTextColor));
|
||||
}
|
||||
|
||||
/// Получаем текст сообщения, в зависимости от статуса активации.
|
||||
@@ -101,7 +119,8 @@ class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
|
||||
/// Фоновое изображение для сообщения.
|
||||
Decoration _getDecorationForMessageField() {
|
||||
return new BoxDecoration(image: new DecorationImage(
|
||||
image: new ExactAssetImage(_tokenActive ? active_token_bg_png : activate_token_bg_png),
|
||||
image: new ExactAssetImage(
|
||||
_tokenActive ? active_token_bg_png : activate_token_bg_png),
|
||||
fit: _tokenActive ? BoxFit.fitWidth : BoxFit.fill));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user