Экраны настроек

This commit is contained in:
Ivan Murashov
2017-09-11 14:51:50 +03:00
parent 0dde204dcd
commit 24fdfc15f6
21 changed files with 148 additions and 98 deletions

View File

@@ -0,0 +1,46 @@
import 'package:checker/base/base_state.dart';
import 'package:checker/consts.dart';
import 'package:checker/strings.dart';
import 'package:flutter/material.dart';
abstract class SettingsBaseState<T extends StatefulWidget> extends BaseState<T> {
@override
Widget getScreenContent() {
List<Widget> widgets = new List();
for (String option in getOptions()) {
widgets.add(getItem(option));
}
return new ListView(children: widgets);
}
List<String> getOptions();
@override
List<Widget> getMenuButtons() {
return null;
}
Widget getItem(String option) {
return new Container(
height: 56.0,
child: (new FlatButton(onPressed: null,
child: new Row(children: <Widget>[
new Expanded(child: new Text(option)),
getCheckMark()]))));
}
Widget getCheckMark() {
return new Image.asset(check_png,
width: 28.0,
height: 28.0);
}
@override
String getTitle() {
return StringsLocalization.settings();
}
}