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
| dependencies: | |
| flutter: | |
| sdk: flutter | |
| my_new_package: | |
| path: ./my_new_package |
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
| // Copyright 2025 Fredrick Allan Grott. All rights reserved. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| /// Flutter widgets and utils that simplify usage of | |
| /// Material Design 3 Expressive (M3X) theming available in Flutter. | |
| /// | |
| /// To use import using a local path as I am not publishing it as | |
| /// a public package. | |
| /// |
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
| // Copyright 2025 Fredrick Allan Grott. All rights reserved. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| // ignore_for_file: avoid_classes_with_only_static_members | |
| /// | |
| library; | |
| import 'package:motor/motor.dart'; |
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
| // Copyright 2025 Fredrick Allan Grott. All rights reserved. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| /// | |
| // ignore_for_file: avoid_classes_with_only_static_members | |
| /// | |
| library; |
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
| import 'package:motor/motor.dart'; | |
| final controller = SequenceMotionController<ButtonState, Offset>( | |
| motion: Motion.smoothSpring(), | |
| vsync: this, | |
| converter: MotionConverter.offset, | |
| initialValue: Offset.zero, | |
| ); | |
| final sequence = MotionSequence.states({ |
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
| import 'package:motor/motor.dart'; | |
| final controller = MotionController( | |
| motion: CupertinoMotion.bouncy(), // or Motion.duration(), etc. | |
| vsync: this, | |
| ); |
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
| import 'package:motor/motor.dart'; | |
| final controller = PhaseMotionController<ButtonState, Offset>( | |
| motion: .smoothSpring(), | |
| vsync: this, | |
| converter: .offset, | |
| initialValue: .zero, | |
| ); | |
| // Play a sequence |
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
| import 'package:motor/motor.dart'; | |
| final complexSequence = MotionSequence<AppState, ButtonStyle>.statesWithMotions({ | |
| .loading: (loadingStyle, .smoothSpring()), | |
| .error: (errorStyle, .bouncySpring()), // Extra bounce for attention | |
| .success: (successStyle, .curved(Duration(seconds: 2), Curves.ease)), | |
| }); |
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
| import 'pacakge:motor/motor.dart'; | |
| enum LoadingState { idle, spinning, complete } | |
| SequenceMotionBuilder<LoadingState, double>( | |
| sequence: .states({ | |
| .idle: 0.0, | |
| .spinning: 2 * pi, | |
| .complete: 2 * pi, | |
| }, motion: .smoothSpring()), |
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
| import 'package:motor/motor.dart'; | |
| final logoSequence = MotionSequence.spanning({ | |
| 0.0: LogoState(opacity: 0), // Start (0% of total time) | |
| 1.0: LogoState(opacity: 1), // 50% of total time | |
| 2.0: LogoState(opacity: 1, text: 1), // 100% of total time | |
| }, motion: .linear(Duration(seconds: 2))); |
NewerOlder