Skip to content

Commit 9722f44

Browse files
clocksmithwilllarche
authored andcommitted
[104] Replaces regular hamburger menu behavior with a branded version (#22)
* [104] Replaces regular hamburger menu behavior with a branded icon version. * Fixed space nit and refactored branded icon into its own var. * whitespace
1 parent 2f6a3fd commit 9722f44

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed
239 Bytes
Loading
302 Bytes
Loading
149 Bytes
Loading

mdc_100_series/lib/backdrop.dart

+24-10
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class _BackdropState extends State<Backdrop>
150150
setState(() {
151151
_controller.fling(
152152
velocity:
153-
_backdropPanelVisible ? -_kFlingVelocity : _kFlingVelocity);
153+
_backdropPanelVisible ? -_kFlingVelocity : _kFlingVelocity);
154154
});
155155
} else if (!_backdropPanelVisible) {
156156
setState(() {
@@ -204,20 +204,34 @@ class _BackdropState extends State<Backdrop>
204204

205205
@override
206206
Widget build(BuildContext context) {
207+
var brandedIcon = Row(children: <Widget>[
208+
ImageIcon(AssetImage('assets/slanted_menu.png')),
209+
ImageIcon(AssetImage('assets/diamond.png')),
210+
]);
211+
207212
var appBar = AppBar(
208213
brightness: Brightness.light,
209214
elevation: 0.0,
210-
leading: IconButton(
211-
onPressed: _toggleBackdropPanelVisibility,
212-
icon: AnimatedIcon(
213-
icon: AnimatedIcons.close_menu,
214-
progress: _controller.view,
215-
),
216-
),
215+
titleSpacing: 0.0,
217216
title: _BackdropTitle(
218217
listenable: _controller.view,
219-
frontTitle: widget.frontTitle,
220-
backTitle: widget.backTitle,
218+
frontTitle: Row(
219+
children: <Widget>[
220+
SizedBox(
221+
width: 72.0,
222+
child: IconButton(
223+
padding: EdgeInsets.only(left: 20.0),
224+
onPressed: _toggleBackdropPanelVisibility,
225+
icon: brandedIcon,
226+
),
227+
),
228+
widget.frontTitle,
229+
],
230+
),
231+
backTitle: IconButton(
232+
onPressed: _toggleBackdropPanelVisibility,
233+
icon: Icon(Icons.close),
234+
),
221235
),
222236
actions: <Widget>[
223237
new IconButton(

mdc_100_series/pubspec.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ flutter:
1717
uses-material-design: true
1818
assets:
1919
- assets/diamond.png
20+
- assets/slanted_menu.png
2021
- packages/shrine_images/0-0.jpg
2122
- packages/shrine_images/1-0.jpg
2223
- packages/shrine_images/2-0.jpg

0 commit comments

Comments
 (0)