Skip to content

Commit

Permalink
pass in text string and use new (was const) to make it work
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Hong Xiao committed Mar 17, 2018
1 parent 387408b commit cf92a29
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,7 @@ class _ListDemoState extends State<ListDemo> {
}

MergeSemantics _mergeSemanticsOf(String text, _MaterialListType listType) {
//const Text t = const Text(text);
const Text t = const Text('we want a variable here');
return new MergeSemantics(
child: new ListTile(
dense: true,
title: t,
trailing: new Radio<_MaterialListType>(
value: listType,
groupValue: _itemType,
onChanged: changeItemType,
)),
);
}

MergeSemantics _mergeSemanticsOfOneline(_MaterialListType listType) {
const Text t = const Text('one line');
return new MergeSemantics(
child: new ListTile(
dense: true,
title: t,
trailing: new Radio<_MaterialListType>(
value: listType,
groupValue: _itemType,
onChanged: changeItemType,
)),
);
}

MergeSemantics _mergeSemanticsOfTwoline(_MaterialListType listType) {
const Text t = const Text('Two-line');
Text t = new Text(text);
return new MergeSemantics(
child: new ListTile(
dense: true,
Expand Down Expand Up @@ -115,8 +86,8 @@ class _ListDemoState extends State<ListDemo> {
void _showConfigurationSheet() {
final PersistentBottomSheetController<Null> bottomSheet = scaffoldKey
.currentState.showBottomSheet((BuildContext bottomSheetContext) {
final msOneline = _mergeSemanticsOfOneline(_MaterialListType.oneLine);
final msTwoline = _mergeSemanticsOfTwoline(_MaterialListType.twoLine);
final msOneline = _mergeSemanticsOf('1 line', _MaterialListType.oneLine);
final msTwoline = _mergeSemanticsOf('2 line', _MaterialListType.twoLine);
final msShowIcon = _mergeSemanticsOfShowIcon();

return new Container(
Expand Down

0 comments on commit cf92a29

Please sign in to comment.