This file contains 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 'dart:ui' as ui; | |
import 'package:flutter/gestures.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:collection/collection.dart'; | |
import 'package:flutter/physics.dart'; | |
main() { | |
runApp(MaterialApp( |
This file contains 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:collection'; | |
import 'dart:math'; | |
import 'dart:ui' as ui; | |
import 'package:collection/collection.dart'; | |
import 'package:flutter/material.dart'; | |
// TODO | |
// * check if [radius] / [radii] are not too big? | |
// * use [Path.arcToPoint] so [radius] (and [radii]) can be specified as [Radius] |
This file contains 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 FooPerspective extends StatefulWidget { | |
@override | |
State<FooPerspective> createState() => _FooPerspectiveState(); | |
} | |
class _FooPerspectiveState extends State<FooPerspective> with TickerProviderStateMixin { | |
static const src = [ | |
Offset(0, 0), | |
Offset(100, 0), |
This file contains 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 ValueNotifierAnimationTest extends StatefulWidget { | |
@override | |
State<ValueNotifierAnimationTest> createState() => _ValueNotifierAnimationTestState(); | |
} | |
class _ValueNotifierAnimationTestState extends State<ValueNotifierAnimationTest> { | |
late ValueNotifierAnimation<double> _animation; | |
late ValueNotifierAnimation<double> _opacity; | |
late Animation<double> _mean; |
This file contains 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 'dart:ui' show lerpDouble; | |
import 'dart:ui' as ui; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/gestures.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/scheduler.dart'; | |
/// Functional equivalent of [RSTransform] in [Matrix4] world, |
This file contains 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'; | |
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
/* | |
class CornerDecorationTest extends StatefulWidget { | |
@override | |
_CornerDecorationTestState createState() => _CornerDecorationTestState(); | |
} |
This file contains 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:async'; | |
import 'dart:math'; | |
import 'dart:ui' as ui; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
// provides: | |
// 1. DecorationStack |
This file contains 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'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
/// A custom [Scrollable] with a fixed content. | |
/// | |
/// Can be used with: | |
/// 1. static content animated with given [ViewportOffset] |
This file contains 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
/* | |
// sample usage: | |
child: ColorFilteredPageView( | |
image: NetworkImage('https://unsplash.com/photos/3fEzry0pIms/download?force=true&w=640'), | |
filters: myFilters, | |
filterNames: myFilterNames, | |
), | |
*/ |
This file contains 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:flutter/widgets.dart'; | |
/* | |
// first example | |
// | |
// the most important parts of the code is: | |
// | |
// ❶ - super(relayout: _animationController) it means that performLayout() method | |
// will be called whenever _animationController notifies its listeners | |
// ❷ - layoutChild() where each child is sized with its "default" size |