Skip to content

Commit

Permalink
Use new InteractiveFlag convenience methods
Browse files Browse the repository at this point in the history
  • Loading branch information
rorystephenson committed Jun 10, 2023
1 parent fcdcc4e commit ac8173e
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions example/lib/pages/interactive_test_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class _InteractiveTestPageState extends State<InteractiveTestPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
MaterialButton(
color: InteractiveFlag.hasFlag(flags, InteractiveFlag.drag)
color: InteractiveFlag.hasDrag(flags)
? Colors.greenAccent
: Colors.redAccent,
onPressed: () {
Expand All @@ -70,8 +70,7 @@ class _InteractiveTestPageState extends State<InteractiveTestPage> {
child: const Text('Drag'),
),
MaterialButton(
color: InteractiveFlag.hasFlag(
flags, InteractiveFlag.flingAnimation)
color: InteractiveFlag.hasFlingAnimation(flags)
? Colors.greenAccent
: Colors.redAccent,
onPressed: () {
Expand All @@ -82,10 +81,9 @@ class _InteractiveTestPageState extends State<InteractiveTestPage> {
child: const Text('Fling'),
),
MaterialButton(
color:
InteractiveFlag.hasFlag(flags, InteractiveFlag.pinchMove)
? Colors.greenAccent
: Colors.redAccent,
color: InteractiveFlag.hasPinchMove(flags)
? Colors.greenAccent
: Colors.redAccent,
onPressed: () {
setState(() {
updateFlags(InteractiveFlag.pinchMove);
Expand All @@ -99,8 +97,7 @@ class _InteractiveTestPageState extends State<InteractiveTestPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
MaterialButton(
color: InteractiveFlag.hasFlag(
flags, InteractiveFlag.doubleTapZoom)
color: InteractiveFlag.hasDoubleTapZoom(flags)
? Colors.greenAccent
: Colors.redAccent,
onPressed: () {
Expand All @@ -111,7 +108,7 @@ class _InteractiveTestPageState extends State<InteractiveTestPage> {
child: const Text('Double tap zoom'),
),
MaterialButton(
color: InteractiveFlag.hasFlag(flags, InteractiveFlag.rotate)
color: InteractiveFlag.hasRotate(flags)
? Colors.greenAccent
: Colors.redAccent,
onPressed: () {
Expand All @@ -122,10 +119,9 @@ class _InteractiveTestPageState extends State<InteractiveTestPage> {
child: const Text('Rotate'),
),
MaterialButton(
color:
InteractiveFlag.hasFlag(flags, InteractiveFlag.pinchZoom)
? Colors.greenAccent
: Colors.redAccent,
color: InteractiveFlag.hasPinchZoom(flags)
? Colors.greenAccent
: Colors.redAccent,
onPressed: () {
setState(() {
updateFlags(InteractiveFlag.pinchZoom);
Expand Down

0 comments on commit ac8173e

Please sign in to comment.