This repository was archived by the owner on Nov 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 190
Update backdrop.md #25
Open
velociberry
wants to merge
5
commits into
material-components:develop
Choose a base branch
from
velociberry:patch-1
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,9 @@ | |
#### Engineering Guidance Document | ||
|
||
### What is the backdrop? | ||
The backdrop is a component that consists of a back layer and a front layer. The back layer may be revealed to show context and actions that are relevant to the front layer’s content. To learn more about the backdrop, take a look at the [Material Guidelines](https://material.io/design/components/backdrop.html#). | ||
The backdrop is a component that consists of a **back layer** and a **front layer**. The front layer displays content. When the back layer is revealed, it shows context and actions related to the front layer’s content. | ||
|
||
To learn more about the backdrop, take a look at the [Material Guidelines](https://material.io/design/components/backdrop.html#). | ||
|
||
<img src="resources/crane-backdrop.png" alt="Backdrop in Crane Material Study" width="300"> | ||
|
||
|
@@ -11,10 +13,13 @@ _No._ In Flutter, the backdrop is an advanced component. Advanced components don | |
|
||
### What are some good ideas for building my own? | ||
When you break it down, backdrops are composed of 2 pieces: | ||
1. The front layer, a view that displays the user’s main content whose height can change to reveal information behind it on certain events. | ||
1. The back layer, that contains context and actionable items that can change the information shown on the front layer. | ||
1. The front layer, a view that displays the user’s main content. It's height can change to reveal information behind it on certain events. | ||
1. The back layer, which contains context and actionable items. Changes here update the information shown on the front layer. | ||
|
||
To start, you can use a [StatefulWidget](https://material.io/design/components/backdrop.html#) to tie the two pieces together. This widget contains the back layer and other widgets, such as the [AppBar](https://flutter.io/catalog/samples/basic-app-bar). You will have a separate widget to build out the front layer. | ||
|
||
You probably want to start with a [StatefulWidget](https://material.io/design/components/backdrop.html#) that ties the two pieces together. This widget will contain the back layer and other widgets such as the [AppBar](https://flutter.io/catalog/samples/basic-app-bar). You will have a separate widget to build out the front layer. To produce the open/close motion of the front layer, build an animation in the back layer’s parent widget and manage it with an [AnimationController](https://docs.flutter.io/flutter/animation/AnimationController-class.html). Then implement a button on the AppBar to trigger the animation. | ||
**Backdrop motion** | ||
velociberry marked this conversation as resolved.
Show resolved
Hide resolved
|
||
To produce the open/close motion of the front layer, build an animation in the back layer’s parent widget. Manage that motion with an [AnimationController](https://docs.flutter.io/flutter/animation/AnimationController-class.html). To trigger the animation, implement a button on the AppBar. | ||
|
||
### Example code | ||
Example code for building a simple backdrop can be found in the [MDC-Flutter codelabs repo](https://github.com/material-components/material-components-flutter-codelabs/blob/104-complete/mdc_100_series/lib/backdrop.dart). | ||
|
@@ -28,15 +33,15 @@ See [MDC-103 for Flutter](http://codelabs.developers.google.com/codelabs/mdc-103 | |
To learn more about animations in Flutter, see [flutter.io/animations](flutter.io/animations). | ||
|
||
### From a designer’s point of view | ||
The backdrop is an opportunity to give users easy access to an important element of the app that is secondary to another element. The backdrop’s back layer is persistent yet unobtrusive. Users have immediate access to the actions and content relevant to the front layer. | ||
The backdrop gives users easy access to an important, secondary element of an app. Its back layer is persistent yet unobtrusive, giving users access to the actions and content relevant to the front layer. | ||
|
||
### Why not a reusable code component? | ||
_The backdrop is complex._ The component uses multiple types of animations and may depend on app-specific models or information. The level of complexity makes it difficult to generalize for a variety of contexts and a poor candidate for a reusable code component. | ||
_The backdrop is complex._ The component uses multiple types of animations and may depend on app-specific models or information. This makes it difficult to generalize across a variety of contexts. It's not a good candidate for a reusable code component. | ||
|
||
_The appearance of the backdrop can change with context._ | ||
* Some apps may only need a single front layer and back layer, containing the backdrop to a vertical back and forth interaction. | ||
* Some apps only need a single front layer and back layer, containing the backdrop to a vertical back and forth interaction. | ||
|
||
* Tabs may necessitate multiple front layer widgets and may also require custom widgets, as the widgets in Flutter don’t currently support the desired interactions. | ||
velociberry marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
In the Material Study [Shrine](https://material.io/design/material-studies/shrine.html#product-architecture), backdrop unveils a menu to filter the products found on the front layer. In [Crane](https://material.io/design/material-studies/crane.html), the backdrop has multiple front layers that change content based on the selected Tab. The backdrop component has many different uses with various potential uses and doesn’t fit a one size fits all. | ||
In the Material study [Shrine](https://material.io/design/material-studies/shrine.html#product-architecture), the backdrop unveils a menu that allows users to filter products shown on the front layer. In [Crane](https://material.io/design/material-studies/crane.html), the backdrop has multiple front layers, and each front layer changes content based on the selected Tab. The backdrop component can be used many different ways. It isn't a one-size-fits-all component. | ||
|
||
_A backdrop is meant to be used only once per app._ You don't need to instantiate more than one for a normal experience even if you have multiple front layers. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.