Регистрация кассы, авторизация, сканнер готовы к демонстрации

This commit is contained in:
Ivan Murashov
2017-07-21 11:52:57 +03:00
parent c9dba5bb08
commit 013a75e464
6 changed files with 81 additions and 124 deletions

View File

@@ -7,7 +7,7 @@ class FinishRegistrationScreen extends StatefulWidget {
@override State createState() => new _RegistrationScreenState();
}
class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
class _RegistrationScreenState extends State<FinishRegistrationScreen> {
@override Widget build(BuildContext context) {
return new Scaffold(appBar: _getAppBar(), body: _getScreen(context));
@@ -18,22 +18,14 @@ class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
backgroundColor: primaryColor, actions: <Widget>[
new IconButton(
icon: new Icon(Icons.help_outline),
tooltip: 'Air it',
onPressed: faq,
),
new IconButton(
icon: new Image(height: 24.0, width: 24.0, image: new AssetImage(logout_png)),
tooltip: 'Restitch it',
onPressed: logout,
)
]);
onPressed: () {}
)]);
}
Widget _getScreen(BuildContext context) {
return new Center(child: new Column(children: <Widget>[
_getLogo(),
_getDecoratedInputField(merchantIDHint),
_getDecoratedInputField(posIDHint),
_getDecoratedText(),
_getMessage(),
_getButton(context)
]));
@@ -44,27 +36,22 @@ class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
child: new Image.asset(logo_png, height: 24.0, width: 156.0));
}
Container _getDecoratedInputField(String hint) {
return new Container(
padding: new EdgeInsets.only(left: 28.0, right: 28.0, top: 8.0),
child: new Container(height: 48.0,
padding: new EdgeInsets.only(left: 16.0, right: 16.0),
decoration: _getDecoraionForInputField(),
child: _getInputField(hint))) ;
Container _getDecoratedText() {
return new Container(margin: new EdgeInsets.only(left: 28.0, right: 28.0),
padding: new EdgeInsets.only(top: 12.0, bottom: 12.0, left: 16.0, right: 16.0),
decoration: _getDecoraionForMerchantId(),
child: _getMerchantIDText());
}
TextField _getInputField(String hint) {
return new TextField(decoration: new InputDecoration(hintText: hint,
hideDivider: true,
hintStyle: new TextStyle(color: const Color(0xffa5a5a5),
fontSize: 16.0)), onChanged: null);
Text _getMerchantIDText() {
return new Text(merchantID, style: new TextStyle(color: const Color(0xffa5a5a5), fontSize: 16.0));
}
Container _getMessage() {
return new Container(padding: new EdgeInsets.only(top: 20.0, left: 26.0, right: 26.0),
child: new Container(height: 128.0, decoration: _getDecoraionForMessageField(),
padding: new EdgeInsets.only(top: 16.0, bottom: 8.0, left: 28.0, right: 28.0),
child: new Text('Запрос на активацию программы отправлен, дождитесь подтверждения активации администратором',
child: new Text('Запрос на активацию программы отправлен, дождrитесь подтверждения активации администратором',
textAlign: TextAlign.center, style: new TextStyle(fontWeight: FontWeight.bold, color: const Color(0xff4e3a19)))));
}
@@ -73,7 +60,7 @@ class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
image: new ExactAssetImage(activate_token_bg_png), fit: BoxFit.fill));
}
Decoration _getDecoraionForInputField() {
Decoration _getDecoraionForMerchantId() {
return new BoxDecoration(color: Colors.white,
border: new Border.all(color: const Color(0xffcfd8dc), width: 1.0),
borderRadius: new BorderRadius.all(new Radius.circular(4.0)));
@@ -84,9 +71,9 @@ class _RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
child: new Container(height: 64.0, padding: new EdgeInsets.all(8.0),
child: new RaisedButton(child: new Text('Обновить статус активации',
style: new TextStyle(color: Colors.white)),
onPressed: _checkToken(context),
disabledColor: const Color(0xffbfbfbf),
color: const Color(0xff3078c0))));
onPressed: () {
startScanner(context);
})));
}
}