Skip to content

Instantly share code, notes, and snippets.

View chat_gpt_application.dart
import 'package:flutter/widgets.dart';
class Application with WidgetsBindingObserver {
final Widget home;
final Function onLaunch;
final Function onTerminate;
Application({
@required this.home,
this.onLaunch,
View rail_destination_label_highlight.dart
import 'package:flutter/material.dart';
class Home extends StatefulWidget {
const Home({ super.key });
@override
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
View linear_border.dart
import 'dart:ui' show lerpDouble;
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
class LinearBorderEdge {
const LinearBorderEdge({
this.alignment = 0, // -1 start, 0 center, 1 end
this.size = 1, // 0 to 1, percentage of width/height
}) : assert(size >= 0);
View explicit_animation_v2.dart
import 'package:flutter/material.dart';
class Home extends StatefulWidget {
const Home({ super.key });
@override
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
View explicit_animation_v0.dart
import 'dart:ui' show lerpDouble;
import 'package:flutter/material.dart';
class Home extends StatefulWidget {
const Home({ super.key });
@override
State<Home> createState() => _HomeState();
}
View explicit_animation.dart
import 'dart:ui' show lerpDouble;
import 'package:flutter/material.dart';
class Home extends StatefulWidget {
const Home({ super.key });
@override
State<Home> createState() => _HomeState();
}
View glide_v7.dart
/*
The overall goal here is to trigger an animated transition when the width of the application's window crosses a "breakpoint" threshold. When the window's widget is less than the breakpoint's value we'll show a bottom NavigationBar in the app's Scaffold. Otherwise we'll show a NavigationRail to the left or right of the app's body, depending on the prevailing text direction (see Directionality). The animated transition from bottom navigation bar to rail happens in two discrete steps. For example if window's width gets small and we're transitioning from showing the navigation rail to showing the bottom navgation bar:
1 - Slide the rail out of view and return its horizontal space to the app's body.
2 - Slide the bar into up into view, compressing the app's height.
These two steps, which happen one after the other, will happen over 2500ms and be driven by a single AnimationController. All of the component transitions will happen in the half of that time, so the controller and its duration are defined like t
View glide_v7.dart
/*
The overall goal here is to trigger an animated transition when the width of the application's window crosses a "breakpoint" threshold. When the window's widget is less than the breakpoint's value we'll show a bottom NavigationBar in the app's Scaffold. Otherwise we'll show a NavigationRail to the left or right of the app's body, depending on the prevailing text direction (see Directionality). The animated transition from bottom navigation bar to rail happens in two discrete steps. For example if window's width gets small and we're transitioning from showing the navigation rail to showing the bottom navgation bar:
1 - Slide the rail out of view and return its horizontal space to the app's body.
2 - Slide the bar into up into view, compressing the app's height.
These two steps, which happen one after the other, will happen over 2500ms and be driven by a single AnimationController. All of the component transitions will happen in the half of that time, so the controller and its duration are defined like t
View glide_v6.dart
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
const double transitionLength = 1250;
class SizeAnimation extends CurvedAnimation {
SizeAnimation(Animation<double> parent) : super(
parent: parent,
curve: const Interval(
View glide_v5.dart
/*
The overall goal here is to trigger an animated transition when the width of the application's window crosses a "breakpoint" threshold. When the window's widget is less than the breakpoint's value we'll show a bottom NavigationBar in the app's Scaffold. Otherwise we'll show a NavigationRail to the left or right of the app's body, depending on the prevailing text direction (see Directionality). The animated transition from bottom navigation bar to rail happens in two discrete steps. For example if window's width gets small and we're transitioning from showing the navigation rail to showing the bottom navgation bar:
1 - Slide the rail out of view and return its horizontal space to the app's body.
2 - Slide the bar into up into view, compressing the app's height.
These two steps, which happen one after the other, will happen over 2500ms and be driven by a single AnimationController. All of the component transitions will happen in the half of that time, so the controller and its duration are defined like t