Skip to content

Commit 53b396b

Browse files
committed
refactor
1 parent f154d17 commit 53b396b

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ packages:
8787
path: ".."
8888
relative: true
8989
source: path
90-
version: "1.0.0+1"
90+
version: "1.1.0"
9191
scroll_to_index:
9292
dependency: transitive
9393
description:

lib/templates/3-column/three_column_navigation.dart

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,27 @@ class ThreeColumnNavigation extends StatefulWidget {
1515
this.bottomAppBar,
1616
this.backgroundColor,
1717
this.title,
18-
}) : _adaptive = false;
18+
});
19+
20+
final Color backgroundColor;
21+
final Widget bottomAppBar;
22+
final IconData expandedIconData, collapsedIconData;
23+
final bool initiallyExpanded;
1924
List<MainSection> sections;
20-
final bool _adaptive;
2125
final bool showDetailsArrows;
22-
final bool initiallyExpanded;
23-
final IconData expandedIconData, collapsedIconData;
24-
final Widget bottomAppBar;
25-
final Color backgroundColor;
2626
final Text title;
27+
2728
@override
2829
_ThreeColumnNavigationState createState() => _ThreeColumnNavigationState();
2930
}
3031

3132
class _ThreeColumnNavigationState extends State<ThreeColumnNavigation> {
33+
AutoScrollController controller;
34+
3235
bool _expanded = true;
33-
int _sectionIndex = 0;
3436
int _listIndex = 0;
35-
AutoScrollController controller;
3637
final _scaffoldKey = GlobalKey<ScaffoldState>();
38+
int _sectionIndex = 0;
3739

3840
@override
3941
void initState() {
@@ -285,9 +287,11 @@ class SectionsDrawer extends StatelessWidget {
285287
}) : _sectionIndex = sectionIndex,
286288
super(key: key);
287289

290+
final List<MainSection> sections;
291+
288292
final int _sectionIndex;
293+
289294
final Function(BuildContext, int) sectionChanged;
290-
final List<MainSection> sections;
291295

292296
@override
293297
Widget build(BuildContext context) {
@@ -310,13 +314,16 @@ class MainSection {
310314
@required this.label,
311315
this.bottomAppBar,
312316
});
313-
final Text label;
317+
318+
final Widget bottomAppBar;
314319
final Icon icon;
315320
final int itemCount;
321+
final Text label;
322+
316323
final Widget Function(BuildContext context, int index, bool selected)
317324
itemBuilder;
325+
318326
final DetailsWidget Function(BuildContext context, int index) getDetails;
319-
final Widget bottomAppBar;
320327
}
321328

322329
class DetailsWidget {
@@ -326,8 +333,9 @@ class DetailsWidget {
326333
this.title,
327334
this.bottomAppBar,
328335
});
329-
final Text title;
330-
final Widget child;
336+
331337
final List<Widget> actions;
332338
final Widget bottomAppBar;
339+
final Widget child;
340+
final Text title;
333341
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: responsive_scaffold
22
description: On mobile it shows a list and pushes to details and on tablet it shows the List and the selected item.
3-
version: 1.0.0+1
3+
version: 1.1.0
44
author: Rody Davis <rody.davis.jr@gmail.com>
55
homepage: https://github.com/AppleEducate/plugins
66
maintainer: Rody Davis (@AppleEducate)

0 commit comments

Comments
 (0)