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
| /* | |
| child: Center( | |
| child: Container( | |
| decoration: BoxDecoration( | |
| border: Border.all(color: Colors.teal, width: 2), | |
| borderRadius: BorderRadius.circular(32), | |
| color: Colors.white54, | |
| ), | |
| child: Row( | |
| mainAxisSize: MainAxisSize.min, |
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 'dart:ui' as ui; | |
| import 'dart:math' as math; | |
| class FooPageView extends StatelessWidget { | |
| final PageController controller = PageController(); | |
| double get page => controller.position.haveDimensions? controller.page : 0.0; | |
| @override | |
| Widget build(BuildContext context) { |
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
| class RotaryDial extends StatefulWidget { | |
| @override | |
| _RotaryDialState createState() => _RotaryDialState(); | |
| } | |
| class _RotaryDialState extends State<RotaryDial> with SingleTickerProviderStateMixin { | |
| final numbers = List.generate(10, (i) => i != 0? 10 - i : i); | |
| final turns = ProxyAnimation(); | |
| final stackKey = GlobalKey(); | |
| late AnimationController controller; |
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
| class MultiLayoutTest extends StatefulWidget { | |
| @override | |
| _MultiLayoutTestState createState() => _MultiLayoutTestState(); | |
| } | |
| var _data = [ | |
| _Data(0, Colors.orange, Alignment.topRight, Offset(0, -1)), | |
| _Data(1, Colors.red, Alignment.bottomLeft, Offset(-1, 0)), | |
| _Data(2, Colors.green, Alignment.bottomRight, Offset(1, 0)), | |
| _Data(3, Colors.blue, Alignment.topLeft, Offset(0, 1)), |
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
| class CustomImageScroller extends StatefulWidget { | |
| final String asset; | |
| CustomImageScroller({Key key, this.asset}) : super(key: key); | |
| @override | |
| _CustomImageScrollerState createState() => _CustomImageScrollerState(); | |
| } | |
| class _CustomImageScrollerState extends State<CustomImageScroller> with TickerProviderStateMixin { | |
| AnimationController xc; |
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 'dart:math'; | |
| import 'package:flutter/foundation.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/rendering.dart'; | |
| void main() { | |
| // debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia; | |
| runApp(MaterialApp( | |
| home: Scaffold( |
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
| class AnimatedTransform extends ImplicitlyAnimatedWidget { | |
| const AnimatedTransform({ | |
| Key key, | |
| @required this.transform, | |
| this.alignment = Alignment.center, | |
| this.child, | |
| Curve curve = Curves.linear, | |
| @required Duration duration, | |
| VoidCallback onEnd, | |
| }) : assert(transform != null), assert(alignment != null), |
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
| class FruitColorizer extends TextEditingController { | |
| final Map<String, TextStyle> mapping; | |
| final Pattern pattern; | |
| FruitColorizer(this.mapping) | |
| : pattern = RegExp(mapping.keys.map((key) => RegExp.escape(key)).join('|')); | |
| FruitColorizer.fromColors(Map<String, Color> colorMap) | |
| : this(colorMap.map((text, color) => MapEntry(text, TextStyle(color: color)))); |
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
| class LongPressRipple extends StatefulWidget { | |
| final Widget child; | |
| final VoidCallback onLongPress; | |
| LongPressRipple({ | |
| Key key, | |
| this.child, | |
| @required this.onLongPress, | |
| }) : assert(onLongPress != null), super(key: key); |
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
| class BlurView extends StatefulWidget { | |
| final String imagePath; | |
| const BlurView(this.imagePath, {Key key}) : super(key: key); | |
| @override | |
| _BlurViewState createState() => _BlurViewState(); | |
| } | |
| class _BlurViewState extends State<BlurView> { | |
| ui.Image image; |