Files
checker/lib/activate_token.dart

89 lines
3.3 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'main.dart';
/// Экран регистрации магазина и кассы.
class FinishRegistrationScreen extends StatefulWidget {
@override State createState() => new _RegistrationScreenState();
}
class _RegistrationScreenState extends State<FinishRegistrationScreen> {
@override Widget build(BuildContext context) {
return new Scaffold(appBar: _getAppBar(), body: _getScreen(context));
}
AppBar _getAppBar() {
return new AppBar(title: new Text("Регистрация магазина"),
backgroundColor: primaryColor, actions: <Widget>[
new IconButton(
icon: new Icon(Icons.help_outline),
onPressed: () {}
)]);
}
Widget _getScreen(BuildContext context) {
return new Center(child: new Column(children: <Widget>[
_getLogo(),
_getDecoratedText(),
_getMessage(),
_getButton(context)
]));
}
Container _getLogo() {
return new Container(padding: new EdgeInsets.only(top: 16.0, bottom: 16.0),
child: new Image.asset(logo_png, height: 24.0, width: 156.0));
}
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());
}
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('Запрос на активацию программы отправлен, дождrитесь подтверждения активации администратором',
textAlign: TextAlign.center, style: new TextStyle(fontWeight: FontWeight.bold, color: const Color(0xff4e3a19)))));
}
Decoration _getDecoraionForMessageField() {
return new BoxDecoration(image: new DecorationImage(
image: new ExactAssetImage(activate_token_bg_png), fit: BoxFit.fill));
}
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)));
}
Container _getButton(BuildContext context) {
return new Container(padding: new EdgeInsets.only(top: 36.0),
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: () {
startScanner(context);
})));
}
}
_checkToken(BuildContext context) {
checkToken(context, new CheckTokenCallback());
}
class CheckTokenCallback extends Callback {
call(BuildContext context) {
startScanner();
}
}