Purchase screen

This commit is contained in:
Ivan Murashov
2018-05-20 13:47:17 +03:00
parent d9400a3df9
commit beb3732b63

View File

@@ -123,6 +123,10 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
)
));
if (this.coupons.length == 0) {
widgetList.add(new Container(height: 50.0,));
}
listView = new ListView(children: widgetList, controller: scrollController);
return listView;
}
@@ -448,6 +452,8 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
// TODO: Удалить дублирующийся код.
void buildFocusNode() {
var pos = this.coupons.length > 0 ? 150.0 : 100.0;
sumFocusNode.addListener(() {
setState(() {
@@ -456,7 +462,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
}
if (sumFocusNode.hasFocus) {
scrollController.animateTo(150.0, duration: new Duration(seconds: 1), curve: Curves.ease);
scrollController.animateTo(pos, duration: new Duration(seconds: 1), curve: Curves.ease);
}
});
@@ -470,7 +476,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
}
if (bonusFocusNode.hasFocus) {
scrollController.animateTo(150.0, duration: new Duration(seconds: 1), curve: Curves.ease);
scrollController.animateTo(pos, duration: new Duration(seconds: 1), curve: Curves.ease);
}
});