Added button dialog and snackbar demos

This commit is contained in:
Hans Muller
2016-02-08 16:47:55 -08:00
parent c91ace827c
commit 4264d5e749
13 changed files with 703 additions and 313 deletions

View File

@@ -134,7 +134,8 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> {
return new Container(
height: 36.0,
constraints: new BoxConstraints(minWidth: 88.0),
margin: new EdgeDims.all(8.0),
padding: const EdgeDims.symmetric(horizontal: 8.0),
margin: const EdgeDims.all(8.0),
child: contents
);
}

View File

@@ -436,6 +436,12 @@ class TabBarSelectionState<T> extends State<TabBarSelection<T>> {
void initState() {
super.initState();
_value = config.value ?? PageStorage.of(context)?.readState(context) ?? values.first;
// If the selection's values have changed since the selected value was saved with
// PageStorage.writeState() then use the default.
if (!values.contains(_value))
_value = values.first;
_previousValue = _value;
_initValueToIndex();
}
@@ -870,6 +876,7 @@ class _TabBarViewState extends PageableListState<TabBarView> implements TabBarSe
void _updateItemsAndScrollBehavior() {
assert(_selection != null);
final int selectedIndex = _selection.index;
assert(selectedIndex != null);
_updateItemsForSelectedIndex(selectedIndex);
_updateScrollBehaviorForSelectedIndex(selectedIndex);
}