Skip to content

Instantly share code, notes, and snippets.

@funwithflutter
funwithflutter / main.dart
Last active August 10, 2021 21:05
Flutter AnimatedBuilder example
import 'dart:math';
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@funwithflutter
funwithflutter / main.dart
Last active August 10, 2021 21:11
Flutter Animated Widget example
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
@funwithflutter
funwithflutter / main.dart
Last active August 10, 2021 20:29
Flutter Tween Animation Builder example
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
@funwithflutter
funwithflutter / staggered_animation_example.dart
Last active August 10, 2021 21:43
Staggered Animation example
import 'dart:async';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
void main() {
runApp(
const MaterialApp(
debugShowCheckedModeBanner: false,
@funwithflutter
funwithflutter / tween_and_curve_simulator.dart
Last active July 22, 2022 13:47
Flutter example to demonstrate the chaining of Tweens and Cuves, plus creating your own Curves and Tweens classes.
import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@funwithflutter
funwithflutter / hint.txt
Last active August 10, 2021 20:21
Base example for a Container. To be altered to an AnimatedContainer.
"Change Container to AnimatedContainer"
@funwithflutter
funwithflutter / hint.txt
Last active August 10, 2021 20:19
An example of an AnimatedContainer. To be used as an example.
Look at the curve attribute in the AnimatedContainer.
@funwithflutter
funwithflutter / route_transition_notifications.dart
Last active August 10, 2021 22:01
An example showing basic animations on page transitions, pushing and popping different routes.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>();
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@funwithflutter
funwithflutter / bezier_curve_simulator.dart
Last active August 10, 2021 22:15
A Bezier Curve simulator written in Flutter
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
@funwithflutter
funwithflutter / paint_demo.dart
Last active August 10, 2021 22:05
Paint demo with a simple animation. Creates a loading bar.
import 'dart:math';
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override