88 lines
3.1 KiB
Dart
88 lines
3.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'dart:convert';
|
|
import 'dart:async';
|
|
|
|
import 'main.dart';
|
|
import 'activate_token.dart';
|
|
import 'base_state.dart';
|
|
|
|
/// Экран проведения покупки.
|
|
class PurchaseScreen extends StatefulWidget {
|
|
@override State createState() => new _PurchaseScreenState();
|
|
}
|
|
|
|
class _PurchaseScreenState extends BaseState<PurchaseScreen> {
|
|
|
|
@override Widget build(BuildContext context) {
|
|
return new Scaffold(appBar: getAppBar(), body: _getScreen(context));
|
|
}
|
|
|
|
@override String getTitle() {
|
|
return "Проведение покупки";
|
|
}
|
|
|
|
@override getHint() {
|
|
return 'Сумма';
|
|
}
|
|
|
|
@overide getMenuButtons() {
|
|
return <Widget>[new IconButton(icon: new Icon(Icons.help_outline), onPressed: () {})];
|
|
}
|
|
|
|
Widget _getScreen(BuildContext context) {
|
|
return new Stack(children: <Widget>[_getScreenContent(context), getProgressIndicator()]);
|
|
}
|
|
|
|
Widget _getScreenContent(BuildContext context) {
|
|
return new Container(height: 398.0,
|
|
child: new ListView(reverse: true, children: <Widget>[
|
|
new Column(children: <Widget>[
|
|
_getValueWithTitle('ФИО', 'Знаменитый Рокер Паук'),
|
|
_getValueWithTitle('Карта', 'B0399900702'),
|
|
_getValueWithTitle('Вознаграждение', '100%'),
|
|
getHintLabel(),
|
|
getDecoratedTextWidget(),
|
|
_getApprovePurchaseButton(context),
|
|
_getScanButton(context)])
|
|
].reversed.toList()));
|
|
}
|
|
|
|
Widget _getValueWithTitle(String title, String value) {
|
|
return new Container(padding: new EdgeInsets.only(left: verticalMargin, right: verticalMargin, top: 12.0),
|
|
child: new Column(children: <Widget>[
|
|
new Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[new Text(title, textAlign: TextAlign.left, style: new TextStyle(color: greyTextColor, fontSize: 14.0))]),
|
|
new Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[new Text(value, textAlign: TextAlign.left, style: new TextStyle(color: Colors.black, fontSize: 20.0))])
|
|
]));
|
|
}
|
|
|
|
Widget _getApprovePurchaseButton(BuildContext context) {
|
|
return new Container(margin: new EdgeInsets.only(top: 36.0), height: 42.0,
|
|
child: new RaisedButton(child: new Text('ЗАФИКСИРОВАТЬ ПОКУПКУ',
|
|
style: new TextStyle(color: Colors.white)),
|
|
onPressed: () => _purchase(),
|
|
color: primaryColor));
|
|
}
|
|
|
|
Widget _getScanButton(BuildContext context) {
|
|
return new Container(margin: new EdgeInsets.only(top: 36.0), height: 42.0,
|
|
child: new RaisedButton(child: new Container(height: 42.0, child: new Text('СКАНИРОВАТЬ',
|
|
style: new TextStyle(color: Colors.white)),
|
|
decoration: getDecoraionForScanButton()),
|
|
onPressed: () => _purchase()));
|
|
}
|
|
|
|
getDecoraionForScanButton() {
|
|
return new BoxDecoration(
|
|
border: new Border.all(color: primaryColor, width: 1.0),
|
|
borderRadius: new BorderRadius.all(new Radius.circular(4.0)));
|
|
}
|
|
|
|
_purchase() {
|
|
print('purchase');
|
|
}
|
|
|
|
_register(BuildContext context) async {
|
|
|
|
}
|
|
} |