Visitar URL original
Shared Axis Transition Demo App by shihaohong · Pull Request #61 · flutter/packages · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Code review feedback
  • Loading branch information
shihaohong committed Jan 16, 2020
commit 005cd26557a9629726cd7f744bcaa1c8fe61da06
2 changes: 1 addition & 1 deletion packages/animations/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class _TransitionListTile extends StatelessWidget {
this.subtitle,
});

final Function onTap;
final GestureTapCallback onTap;
final String title;
final String subtitle;

Expand Down
14 changes: 7 additions & 7 deletions packages/animations/example/lib/shared_axis_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
SharedAxisTransitionType.horizontal;
bool _isLoggedIn = false;

void updateTransitionType(SharedAxisTransitionType newType) {
void _updateTransitionType(SharedAxisTransitionType newType) {
setState(() {
_transitionType = newType;
});
}

void toggleLoginStatus() {
void _toggleLoginStatus() {
setState(() {
_isLoggedIn = !_isLoggedIn;
});
Expand Down Expand Up @@ -62,12 +62,12 @@ class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
FlatButton(
onPressed: _isLoggedIn ? toggleLoginStatus : null,
onPressed: _isLoggedIn ? _toggleLoginStatus : null,
textColor: Theme.of(context).colorScheme.primary,
child: const Text('BACK'),
),
RaisedButton(
onPressed: _isLoggedIn ? null : toggleLoginStatus,
onPressed: _isLoggedIn ? null : _toggleLoginStatus,
color: Theme.of(context).colorScheme.primary,
textColor: Theme.of(context).colorScheme.onPrimary,
disabledColor: Colors.black12,
Expand All @@ -84,23 +84,23 @@ class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
value: SharedAxisTransitionType.horizontal,
groupValue: _transitionType,
onChanged: (SharedAxisTransitionType newValue) {
updateTransitionType(newValue);
_updateTransitionType(newValue);
},
),
const Text('X'),
Radio<SharedAxisTransitionType>(
value: SharedAxisTransitionType.vertical,
groupValue: _transitionType,
onChanged: (SharedAxisTransitionType newValue) {
updateTransitionType(newValue);
_updateTransitionType(newValue);
},
),
const Text('Y'),
Radio<SharedAxisTransitionType>(
value: SharedAxisTransitionType.scaled,
groupValue: _transitionType,
onChanged: (SharedAxisTransitionType newValue) {
updateTransitionType(newValue);
_updateTransitionType(newValue);
},
),
const Text('Z'),
Expand Down