Skip to content

[104] Replaces regular hamburger menu behavior with a branded version #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added mdc_100_series/assets/2.0x/slanted_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mdc_100_series/assets/3.0x/slanted_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mdc_100_series/assets/slanted_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 24 additions & 10 deletions mdc_100_series/lib/backdrop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class _BackdropState extends State<Backdrop>
setState(() {
_controller.fling(
velocity:
_backdropPanelVisible ? -_kFlingVelocity : _kFlingVelocity);
_backdropPanelVisible ? -_kFlingVelocity : _kFlingVelocity);
});
} else if (!_backdropPanelVisible) {
setState(() {
Expand Down Expand Up @@ -204,20 +204,34 @@ class _BackdropState extends State<Backdrop>

@override
Widget build(BuildContext context) {
var brandedIcon = Row(children: <Widget>[
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is educational code. Move this down to the icon field instead of in a variable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, @maryx had info I didn't. Ignore this request.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

ImageIcon(AssetImage('assets/slanted_menu.png')),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to paint them brown?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a great opportunity to talk about Icon Themes, will do in future PR

ImageIcon(AssetImage('assets/diamond.png')),
]);

var appBar = AppBar(
brightness: Brightness.light,
elevation: 0.0,
leading: IconButton(
onPressed: _toggleBackdropPanelVisibility,
icon: AnimatedIcon(
icon: AnimatedIcons.close_menu,
progress: _controller.view,
),
),
titleSpacing: 0.0,
title: _BackdropTitle(
listenable: _controller.view,
frontTitle: widget.frontTitle,
backTitle: widget.backTitle,
frontTitle: Row(
children: <Widget>[
SizedBox(
width: 72.0,
child: IconButton(
padding: EdgeInsets.only(left: 20.0),
onPressed: _toggleBackdropPanelVisibility,
icon: brandedIcon,
),
),
widget.frontTitle,
],
),
backTitle: IconButton(
onPressed: _toggleBackdropPanelVisibility,
icon: Icon(Icons.close),
),
),
actions: <Widget>[
new IconButton(
Expand Down
1 change: 1 addition & 0 deletions mdc_100_series/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ flutter:
uses-material-design: true
assets:
- assets/diamond.png
- assets/slanted_menu.png
- packages/shrine_images/0-0.jpg
- packages/shrine_images/1-0.jpg
- packages/shrine_images/2-0.jpg
Expand Down