issue 10360, реализация выбора купонов к гашению в покупке

This commit is contained in:
Semyon Babushkin
2017-11-10 19:02:39 +03:00
parent b18064653a
commit 24f66958f4
8 changed files with 145 additions and 60 deletions

View File

@@ -143,6 +143,70 @@ abstract class BaseState<T extends StatefulWidget> extends State<T> {
);
}
getItemToggle(String title, String description) {
if (title.length == 0) {
title = description.substring(0,30) + " ...";
}
return new Container(
margin: new EdgeInsets.only(left: 5.0, right: 5.0, top: 5.0),
child: new Card(
child: new ExpansionTile(
title: new Text(
title,
style: Theme.of(context).textTheme.button.copyWith(
fontWeight: FontWeight.bold,
color: faqTitlesColor
)
),
children: [
new Container(
margin: new EdgeInsets.only(left: 20.0, right: 20.0),
padding: new EdgeInsets.only(top: 0.0, bottom: 10.0),
child: new Text(description),
)
]
)
)
);
}
// Возвращает контейнер с раскрывающимся элементом и переключателем
// title - название, description - описание, isSet - состояние переключаиеля
// handler - обработчик события переключения
getItemToggleSwitch(String title, String description, bool isSet, handler) {
if (title.length == 0) {
title = description.substring(0,25) + " ...";
}
return new Container(
margin: new EdgeInsets.only(left: 5.0, right: 5.0, top: 5.0),
child: new Card(
child: new ExpansionTile(
title: new SwitchListTile(
title: new Text(
title,
style: Theme.of(context).textTheme.button.copyWith(
fontWeight: FontWeight.bold,
color: faqTitlesColor
)
),
value: isSet,
onChanged: handler
),
children: [
new Container(
margin: new EdgeInsets.only(left: 20.0, right: 20.0),
padding: new EdgeInsets.only(top: 0.0, bottom: 10.0),
child: new Text(description),
),
]
)
)
);
}
/// Метод возвращает контейнер только с названием элемента
Widget getItemTitle(String title) {
return new Container(