Fixes, Android adaptive icon for crypto.

This commit is contained in:
Ivan Murashov
2018-03-10 23:41:22 +03:00
parent 60f506a08d
commit cae46b60f9
31 changed files with 238 additions and 0 deletions

View File

@@ -50,6 +50,8 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> {
/// Возвращает контейнер с всеми виджетами экрана.
Widget getScreenContent();
bool isAutomaticallyImplyLeading();
/// Возвращает заголовок для AppBar
String getTitle() {
return null;
@@ -59,6 +61,7 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> {
return new AppBar(title: new Container(
margin: new EdgeInsets.only(left: 16.0),
child: new Text(getTitle(), style: new TextStyle(fontSize: 18.0))),
automaticallyImplyLeading: isAutomaticallyImplyLeading(),
backgroundColor: Resources.getPrimaryColor(app), actions: getMenuButtons());
}

View File

@@ -17,6 +17,7 @@ class _CurrenciesState extends SettingsBaseState<CurrenciesScreen> {
_CurrenciesState(SqliteHelper helper, String app) : super(helper, app);
bool isAutomaticallyImplyLeading() => true;
@override
List<String> getOptions() {

View File

@@ -22,6 +22,8 @@ class EntryItem extends StatelessWidget {
const EntryItem(this.entry);
final Entry entry;
bool isAutomaticallyImplyLeading() => true;
Widget _buildTiles(BuildContext context, Entry root) {
EdgeInsets margin = new EdgeInsets.only(left: 20.0, right: 20.0);
TextStyle titleStyle = Theme.of(context).textTheme.button.copyWith(

View File

@@ -24,6 +24,8 @@ class RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
bool _tokenActive = false;
String _merchantID = '';
bool isAutomaticallyImplyLeading() => false;
@override Widget build(BuildContext context) {
if (_merchantID == '') {
helper.getMerchantID().then((result) {

View File

@@ -18,6 +18,8 @@ class LanguagesState extends SettingsBaseState<LanguagesScreen> {
List<String> languages = const ['ru', 'en', 'ua', 'es'];
bool isAutomaticallyImplyLeading() => true;
@override
List<String> getOptions() {

View File

@@ -37,6 +37,8 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
FocusNode _focusNodeSum = new FocusNode();
FocusNode _focusNodeBonus = new FocusNode();
bool isAutomaticallyImplyLeading() => false;
PurchaseScreenState(SqliteHelper helper, String app, String userString, String card) : super(helper, app) {
this.user = JSON.decode(userString);
this.card = card;

View File

@@ -41,6 +41,8 @@ class PurchaseSuccessScreenState<T> extends BaseState<PurchaseSuccessScreen> {
int currency;
bool showBonus;
bool isAutomaticallyImplyLeading() => false;
@override String getTitle() {
return StringsLocalization.carryingPurchase();
}

View File

@@ -25,6 +25,8 @@ class RegistrationScreenState extends BaseState<RegistrationScreen> {
RegistrationScreenState(SqliteHelper helper, String app) : super(helper, app);
FocusNode _focusNode = new FocusNode();
bool isAutomaticallyImplyLeading() => false;
@override
Widget build(BuildContext ctx) {
return getMainWidget();

View File

@@ -36,6 +36,8 @@ class SettingsState extends BaseState<SettingsScreen> {
bool returnToScanner;
bool isAutomaticallyImplyLeading() => true;
SettingsState(SqliteHelper helper, String app, bool returnToScanner) : super(helper, app) {
this.returnToScanner = returnToScanner;
}

View File

@@ -30,6 +30,8 @@ class _SplashScreenState extends BaseState<SplashScreen> {
_SplashScreenState(SqliteHelper helper, String app) : super(helper, app);
bool a = false;
bool isAutomaticallyImplyLeading() => false;
@override
void initState() {