Добавил локализацию FAQ. Добавил номера телефонов и url сайтов.
This commit is contained in:
@@ -12,6 +12,7 @@ import 'package:checker/db.dart';
|
||||
|
||||
abstract class BaseState<T extends StatefulWidget> extends State<T> {
|
||||
|
||||
/// Класс для работы с бд.
|
||||
SqliteHelper helper;
|
||||
|
||||
/// Тип сборки. Определяет, какие брать ресурсы (цвета, картинки)
|
||||
@@ -71,7 +72,8 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> {
|
||||
child: getMenuItem(logout_png, StringsLocalization.logout()))
|
||||
];
|
||||
}
|
||||
)];
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
void onOptionsItemClick(int index) {
|
||||
@@ -90,6 +92,7 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Возвращает пункт меню (Картинка с текстом)
|
||||
Widget getMenuItem(String image, String text) {
|
||||
return new Row(children: [
|
||||
new Image.asset(image, width: 28.0, height: 28.0),
|
||||
@@ -102,24 +105,24 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> {
|
||||
double horizontalMargin = 8.0;
|
||||
return new Container(margin: new EdgeInsets.only(top: horizontalMargin, bottom: horizontalMargin, left: verticalMargin, right: verticalMargin),
|
||||
child: new Row(crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[new Text(getHintString(), textAlign: TextAlign.left,
|
||||
children: <Widget>[new Text(getHintOrError(), textAlign: TextAlign.left,
|
||||
style: new TextStyle(fontWeight: FontWeight.w300, color: error == null ? greyTextColor : Resources.getPrimaryColor(app), fontSize: 14.0))]));
|
||||
}
|
||||
|
||||
/// Возвращает подсказку, либо ошибку, если введенные в поле ввода данные неверны.
|
||||
String getHintString() {
|
||||
String getHintOrError() {
|
||||
if (dinCode.length == 0 && error == null) {
|
||||
return ' ';
|
||||
} else if (error != null) {
|
||||
return error;
|
||||
} else {
|
||||
return getHint();
|
||||
return getHintString();
|
||||
}
|
||||
}
|
||||
|
||||
/// Возвращает текст подсказки для поля ввода.
|
||||
/// Должен быть переопределен на экранах, на которых есть поле ввода.
|
||||
String getHint() {
|
||||
String getHintString() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -199,5 +202,4 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> {
|
||||
Widget wrapButton(EdgeInsets margin, Widget widget) {
|
||||
return new Container(margin: margin, height: buttonHeight, child: new Row(children: <Widget>[new Expanded(child: widget)]));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user