Skip to content

Instantly share code, notes, and snippets.

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(
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]
/*
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),
/*
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;
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,
import 'dart:ui';
import 'dart:math';
import 'package:flutter/material.dart';
/*
class CornerDecorationTest extends StatefulWidget {
@override
_CornerDecorationTestState createState() => _CornerDecorationTestState();
}
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
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]
/*
// sample usage:
child: ColorFilteredPageView(
image: NetworkImage('https://unsplash.com/photos/3fEzry0pIms/download?force=true&w=640'),
filters: myFilters,
filterNames: myFilterNames,
),
*/
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