Files
checker/lib/purchase_success.dart

55 lines
1.8 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';
import 'base_state.dart';
import 'purchase.dart';
/// Экран проведения покупки.
class PurchaseSuccessScreen extends StatefulWidget {
String val = '';
PurchaseSuccessScreen(String val) {
this.val = val;
}
@override State createState() => new PurchaseSuccessScreenState(val);
}
class PurchaseSuccessScreenState<T> extends PurchaseScreenState<T> {
String val = '';
PurchaseSuccessScreenState(String val) {
this.val = val;
}
@override String getTitle() {
return "Проведение покупки";
}
@overide getMenuButtons(BuildContext context) {
return <Widget>[
new IconButton(icon: new Icon(Icons.help_outline), onPressed: () {}),
new IconButton(icon: new Image.asset(logout_png, height: 20.0, width: 20.0), onPressed: () => logout(context))
];
}
@override Widget getScreenContent() {
return new Column(children: <Widget>[
getValueWithTitle('Покупатель', 'Знаменитый Рокер Паук'),
getSuccessMessage(),
new Expanded(child: new Center()),
buildButton(new EdgeInsets.only(bottom: 74.0, left: buttonVerticalMargin, right: buttonVerticalMargin), buildRaisedButton(context, 'СКАНИРОВАТЬ', () => startScanner(context)))
]);
}
getSuccessMessage() {
return new Row(children: <Widget>[new Expanded(child: new Container(margin: new EdgeInsets.only(top: 20.0), height: 64.0,
decoration: new BoxDecoration(color: greenBackground),
child: new Center(child: new Text('Покупка на сумму ${val} руб. проведена', textAlign: TextAlign.center,
style: new TextStyle(fontWeight: FontWeight.bold, color: tokenActiveTextColor)))))]);
}
}