rand dart fix
This commit is contained in:
@@ -51,16 +51,15 @@ class DetailsView extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
if (_details?.title != null)
|
||||
Expanded(
|
||||
child: Center(child: _details.title),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(child: _details.title),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: _details?.actions,
|
||||
actions: _details.actions,
|
||||
),
|
||||
body: _details.child,
|
||||
bottomNavigationBar: _details?.bottomAppBar,
|
||||
bottomNavigationBar: _details.bottomAppBar,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,9 +85,9 @@ class _ThreeColumnNavigationState extends State<ThreeColumnNavigation> {
|
||||
Container(
|
||||
width: 300,
|
||||
child: Scaffold(
|
||||
backgroundColor: widget?.backgroundColor,
|
||||
backgroundColor: widget.backgroundColor,
|
||||
appBar: AppBar(
|
||||
title: widget?.title,
|
||||
title: widget.title,
|
||||
leading: IconButton(
|
||||
icon: Icon(widget.expandedIconData),
|
||||
onPressed: () {
|
||||
@@ -111,7 +111,7 @@ class _ThreeColumnNavigationState extends State<ThreeColumnNavigation> {
|
||||
}
|
||||
},
|
||||
),
|
||||
bottomNavigationBar: widget?.bottomAppBar,
|
||||
bottomNavigationBar: widget.bottomAppBar,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
@@ -164,7 +164,7 @@ class _ThreeColumnNavigationState extends State<ThreeColumnNavigation> {
|
||||
},
|
||||
),
|
||||
bottomNavigationBar:
|
||||
widget.sections[_sectionIndex]?.bottomAppBar,
|
||||
widget.sections[_sectionIndex].bottomAppBar,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -221,7 +221,7 @@ class _ThreeColumnNavigationState extends State<ThreeColumnNavigation> {
|
||||
},
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: widget.sections[_sectionIndex]?.label,
|
||||
title: widget.sections[_sectionIndex].label,
|
||||
),
|
||||
body: SectionList(
|
||||
controller: controller,
|
||||
@@ -250,7 +250,7 @@ class _ThreeColumnNavigationState extends State<ThreeColumnNavigation> {
|
||||
}
|
||||
},
|
||||
),
|
||||
bottomNavigationBar: widget.sections[_sectionIndex]?.bottomAppBar,
|
||||
bottomNavigationBar: widget.sections[_sectionIndex].bottomAppBar,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -46,16 +46,16 @@ class ResponsiveScaffold extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
if (drawer != null) ...[
|
||||
SizedBox(
|
||||
width: _drawerWidth,
|
||||
child: Drawer(
|
||||
child: SafeArea(
|
||||
child: drawer,
|
||||
),
|
||||
...[
|
||||
SizedBox(
|
||||
width: _drawerWidth,
|
||||
child: Drawer(
|
||||
child: SafeArea(
|
||||
child: drawer,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
key: scaffoldKey,
|
||||
@@ -64,9 +64,9 @@ class ResponsiveScaffold extends StatelessWidget {
|
||||
automaticallyImplyLeading: false,
|
||||
title: title,
|
||||
actions: <Widget>[
|
||||
if (trailing != null) ...[
|
||||
trailing,
|
||||
],
|
||||
...[
|
||||
trailing,
|
||||
],
|
||||
],
|
||||
),
|
||||
body: Row(
|
||||
@@ -74,30 +74,30 @@ class ResponsiveScaffold extends StatelessWidget {
|
||||
Expanded(
|
||||
child: body ?? Container(),
|
||||
),
|
||||
if (endDrawer != null) ...[
|
||||
Container(
|
||||
width: _drawerWidth,
|
||||
child: Drawer(
|
||||
elevation: 3.0,
|
||||
child: SafeArea(
|
||||
child: endDrawer,
|
||||
),
|
||||
...[
|
||||
Container(
|
||||
width: _drawerWidth,
|
||||
child: Drawer(
|
||||
elevation: 3.0,
|
||||
child: SafeArea(
|
||||
child: endDrawer,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (floatingActionButton != null) ...[
|
||||
Positioned(
|
||||
top: 100.0,
|
||||
left: _drawerWidth - 30,
|
||||
child: floatingActionButton,
|
||||
)
|
||||
],
|
||||
...[
|
||||
Positioned(
|
||||
top: 100.0,
|
||||
left: _drawerWidth - 30,
|
||||
child: floatingActionButton,
|
||||
)
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -105,9 +105,7 @@ class ResponsiveScaffold extends StatelessWidget {
|
||||
if (constraints.maxWidth >= kTabletBreakpoint) {
|
||||
return Scaffold(
|
||||
key: scaffoldKey,
|
||||
drawer: drawer == null
|
||||
? null
|
||||
: Drawer(
|
||||
drawer: Drawer(
|
||||
child: SafeArea(
|
||||
child: drawer,
|
||||
),
|
||||
@@ -118,9 +116,9 @@ class ResponsiveScaffold extends StatelessWidget {
|
||||
title: title,
|
||||
leading: _MenuButton(iconData: menuIcon),
|
||||
actions: <Widget>[
|
||||
if (trailing != null) ...[
|
||||
trailing,
|
||||
],
|
||||
...[
|
||||
trailing,
|
||||
],
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
@@ -133,26 +131,26 @@ class ResponsiveScaffold extends StatelessWidget {
|
||||
Expanded(
|
||||
child: body ?? Container(),
|
||||
),
|
||||
if (endDrawer != null) ...[
|
||||
Container(
|
||||
width: _drawerWidth,
|
||||
child: Drawer(
|
||||
elevation: 3.0,
|
||||
child: SafeArea(
|
||||
child: endDrawer,
|
||||
),
|
||||
...[
|
||||
Container(
|
||||
width: _drawerWidth,
|
||||
child: Drawer(
|
||||
elevation: 3.0,
|
||||
child: SafeArea(
|
||||
child: endDrawer,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
if (floatingActionButton != null) ...[
|
||||
Positioned(
|
||||
top: 10.0,
|
||||
left: 10.0,
|
||||
child: floatingActionButton,
|
||||
)
|
||||
],
|
||||
...[
|
||||
Positioned(
|
||||
top: 10.0,
|
||||
left: 10.0,
|
||||
child: floatingActionButton,
|
||||
)
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -160,16 +158,12 @@ class ResponsiveScaffold extends StatelessWidget {
|
||||
}
|
||||
return Scaffold(
|
||||
key: scaffoldKey,
|
||||
drawer: drawer == null
|
||||
? null
|
||||
: Drawer(
|
||||
drawer: Drawer(
|
||||
child: SafeArea(
|
||||
child: drawer,
|
||||
),
|
||||
),
|
||||
endDrawer: endDrawer == null
|
||||
? null
|
||||
: Drawer(
|
||||
endDrawer: Drawer(
|
||||
child: SafeArea(
|
||||
child: endDrawer,
|
||||
),
|
||||
@@ -180,12 +174,12 @@ class ResponsiveScaffold extends StatelessWidget {
|
||||
leading: _MenuButton(iconData: menuIcon),
|
||||
title: title,
|
||||
actions: <Widget>[
|
||||
if (trailing != null) ...[
|
||||
trailing,
|
||||
],
|
||||
if (endDrawer != null) ...[
|
||||
_OptionsButton(iconData: endIcon),
|
||||
]
|
||||
...[
|
||||
trailing,
|
||||
],
|
||||
...[
|
||||
_OptionsButton(iconData: endIcon),
|
||||
]
|
||||
],
|
||||
),
|
||||
body: body,
|
||||
|
||||
@@ -214,7 +214,7 @@ class ResponsiveListScaffold extends StatelessWidget {
|
||||
persistentFooterButtons: persistentFooterButtons,
|
||||
floatingActionButtonAnimator: floatingActionButtonAnimator,
|
||||
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
|
||||
resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
|
||||
resizeToAvoidBottomInset: resizeToAvoidBottomPadding,
|
||||
primary: primary,
|
||||
// extendBody: extendBody,
|
||||
backgroundColor: backgroundColor,
|
||||
|
||||
@@ -69,11 +69,10 @@ class MobileView extends StatelessWidget {
|
||||
..addAll(slivers ?? [])
|
||||
..add(Builder(
|
||||
builder: (BuildContext context) {
|
||||
if (childDelagate?.estimatedChildCount == null && nullItems != null)
|
||||
if (childDelagate.estimatedChildCount == null)
|
||||
return SliverFillRemaining(child: nullItems);
|
||||
if (childDelagate?.estimatedChildCount != null &&
|
||||
childDelagate.estimatedChildCount == 0 &&
|
||||
emptyItems != null)
|
||||
if (childDelagate.estimatedChildCount != null &&
|
||||
childDelagate.estimatedChildCount == 0)
|
||||
return SliverFillRemaining(child: emptyItems);
|
||||
return SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -101,7 +100,7 @@ class MobileView extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
childCount: childDelagate?.estimatedChildCount ?? 0,
|
||||
childCount: childDelagate.estimatedChildCount ?? 0,
|
||||
addAutomaticKeepAlives: false,
|
||||
addRepaintBoundaries: false,
|
||||
addSemanticIndexes: false,
|
||||
|
||||
@@ -171,40 +171,38 @@ class _TabletViewState extends State<TabletView> {
|
||||
body: Flex(
|
||||
direction: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
widget?.sideMenu ?? Container(),
|
||||
widget.sideMenu ?? Container(),
|
||||
Flexible(
|
||||
flex: widget.flexListView,
|
||||
child: Scaffold(
|
||||
key: widget?.scaffoldkey,
|
||||
floatingActionButton: widget?.floatingActionButton,
|
||||
key: widget.scaffoldkey,
|
||||
floatingActionButton: widget.floatingActionButton,
|
||||
floatingActionButtonLocation:
|
||||
widget?.floatingActionButtonLocation,
|
||||
bottomNavigationBar: widget?.bottomNavigationBar,
|
||||
bottomSheet: widget?.bottomSheet,
|
||||
persistentFooterButtons: widget?.persistentFooterButtons,
|
||||
widget.floatingActionButtonLocation,
|
||||
bottomNavigationBar: widget.bottomNavigationBar,
|
||||
bottomSheet: widget.bottomSheet,
|
||||
persistentFooterButtons: widget.persistentFooterButtons,
|
||||
floatingActionButtonAnimator:
|
||||
widget?.floatingActionButtonAnimator,
|
||||
resizeToAvoidBottomInset: widget?.resizeToAvoidBottomInset,
|
||||
resizeToAvoidBottomPadding: widget?.resizeToAvoidBottomPadding,
|
||||
primary: widget?.primary,
|
||||
widget.floatingActionButtonAnimator,
|
||||
resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset,
|
||||
resizeToAvoidBottomInset: widget.resizeToAvoidBottomPadding,
|
||||
primary: widget.primary,
|
||||
// extendBody: extendBody,
|
||||
backgroundColor: widget?.backgroundColor,
|
||||
drawer: widget?.drawer,
|
||||
endDrawer: widget?.endDrawer,
|
||||
appBar: widget?.appBar,
|
||||
backgroundColor: widget.backgroundColor,
|
||||
drawer: widget.drawer,
|
||||
endDrawer: widget.endDrawer,
|
||||
appBar: widget.appBar,
|
||||
body: CustomScrollView(
|
||||
slivers: <Widget>[]
|
||||
..addAll(widget.slivers ?? [])
|
||||
..add(Builder(
|
||||
builder: (BuildContext context) {
|
||||
SliverChildDelegate _childDelagate =
|
||||
widget?.childDelagate;
|
||||
if (_childDelagate?.estimatedChildCount == null &&
|
||||
widget?.nullItems != null)
|
||||
widget.childDelagate;
|
||||
if (_childDelagate.estimatedChildCount == null)
|
||||
return SliverFillRemaining(child: widget.nullItems);
|
||||
if (_childDelagate?.estimatedChildCount != null &&
|
||||
_childDelagate.estimatedChildCount == 0 &&
|
||||
widget?.emptyItems != null)
|
||||
if (_childDelagate.estimatedChildCount != null &&
|
||||
_childDelagate.estimatedChildCount == 0)
|
||||
return SliverFillRemaining(child: widget.emptyItems);
|
||||
return SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
@@ -224,7 +222,7 @@ class _TabletViewState extends State<TabletView> {
|
||||
? Theme.of(context)
|
||||
.chipTheme
|
||||
.disabledColor
|
||||
: widget?.backgroundColor,
|
||||
: widget.backgroundColor,
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: _childDelagate.build(context, index),
|
||||
@@ -233,7 +231,7 @@ class _TabletViewState extends State<TabletView> {
|
||||
),
|
||||
);
|
||||
},
|
||||
childCount: _childDelagate?.estimatedChildCount ?? 0,
|
||||
childCount: _childDelagate.estimatedChildCount ?? 0,
|
||||
addAutomaticKeepAlives: false,
|
||||
addRepaintBoundaries: false,
|
||||
addSemanticIndexes: false,
|
||||
@@ -246,12 +244,11 @@ class _TabletViewState extends State<TabletView> {
|
||||
Flexible(
|
||||
flex: widget.flexDetailView,
|
||||
child: new _DetailView(
|
||||
detailScaffoldKey: widget?.detailScaffoldKey,
|
||||
details: _index == null ||
|
||||
_index > widget.childDelagate.estimatedChildCount - 1
|
||||
detailScaffoldKey: widget.detailScaffoldKey,
|
||||
details: _index > widget.childDelagate.estimatedChildCount - 1
|
||||
? null
|
||||
: widget.detailBuilder(context, _index, true),
|
||||
itemNotSelected: widget?.itemNotSelected,
|
||||
itemNotSelected: widget.itemNotSelected,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user