Работает функционал переключения валют, остались правки по ui
This commit is contained in:
@@ -41,7 +41,6 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return getMainWidget();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,9 +5,15 @@ import 'package:flutter/material.dart';
|
||||
|
||||
abstract class SettingsBaseState<T extends StatefulWidget> extends BaseState<T> {
|
||||
|
||||
int selectedItem;
|
||||
|
||||
@override
|
||||
Widget getScreenContent() {
|
||||
|
||||
print('getScreenContent: $selectedItem');
|
||||
getSelectedValue();
|
||||
|
||||
|
||||
List<Widget> widgets = new List();
|
||||
|
||||
for (String option in getOptions()) {
|
||||
@@ -19,6 +25,10 @@ abstract class SettingsBaseState<T extends StatefulWidget> extends BaseState<T>
|
||||
|
||||
List<String> getOptions();
|
||||
|
||||
void saveOption();
|
||||
|
||||
void getSelectedValue();
|
||||
|
||||
@override
|
||||
List<Widget> getMenuButtons() {
|
||||
return null;
|
||||
@@ -27,16 +37,21 @@ abstract class SettingsBaseState<T extends StatefulWidget> extends BaseState<T>
|
||||
Widget getItem(String option) {
|
||||
return new Container(
|
||||
height: 56.0,
|
||||
child: (new FlatButton(onPressed: null,
|
||||
child: (new FlatButton(onPressed: () {
|
||||
saveOption();
|
||||
setState(() {
|
||||
selectedItem = getOptions().indexOf(option);
|
||||
});
|
||||
},
|
||||
child: new Row(children: <Widget>[
|
||||
new Expanded(child: new Text(option)),
|
||||
getCheckMark()]))));
|
||||
getCheckMark(getOptions().indexOf(option))]))));
|
||||
}
|
||||
|
||||
Widget getCheckMark() {
|
||||
return new Image.asset(check_png,
|
||||
Widget getCheckMark(int index) {
|
||||
return index == selectedItem ? new Image.asset(check_png,
|
||||
width: 28.0,
|
||||
height: 28.0);
|
||||
height: 28.0) : new Image.asset(check_png, color: new Color(0xffffff));
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user