Skip to content

Instantly share code, notes, and snippets.

View esDotDev's full-sized avatar

Shawn esDotDev

  • esDot Studio Inc
  • Edmonton, AB
View GitHub Profile
/// Example usage
///
/// One shot:
// GTweener.fade(from: .9, to: 1, child: const FlutterLogo()),
///
/// Or use a key for future control
// final _tweenKey = GlobalKey<GTweenerState>();
// ...
// return GTweener.fade(key: _tweenKey, child: const FlutterLogo()),
class UrlRouter extends RouterDelegate<String> with ChangeNotifier, PopNavigatorRouterDelegateMixin {
UrlRouter({String url = '/', this.onGeneratePages, this.builder, this.onPopPage, this.onChanging}) {
_initialUrl = url;
assert(onGeneratePages != null || builder != null,
'UrlRouter expects you to implement `builder` or `onGeneratePages` (or both)');
}
/// This delegat analagous to MaterialApp.routes / onGenerateRoute
final List<Page<dynamic>> Function(UrlRouter router)? onGeneratePages;
import os
org = "com.example"
name = "app_name"
cmd = "flutter create --org " + org + " --project-name " + name + " .";
packages = [
"cached_network_image",
"collection",
"copy_with_extension",
"equatable",
// results: http://screens.gskinner.com/shawn/7BMqIUaAVi.mp4
import 'package:flutter/material.dart';
import 'package:focusable_control_builder/focusable_control_builder.dart';
class InkwellDemoTest extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
child: Column(
// Basic structure for inkwell effect
// renders: http://screens.gskinner.com/shawn/vxKbE9nX0x.mp4
class _ButtonTest extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
import 'dart:async';
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
class DeeplinkExample extends StatefulWidget {
@override
_DeeplinkExampleState createState() => _DeeplinkExampleState();
}
class _DeeplinkExampleState extends State<DeeplinkExample> {
late NavStackController _controller;
@override
void initState() {
@esDotDev
esDotDev / decorated_container.dart
Last active May 11, 2021 19:17
Decorated Container
class DecoratedContainer extends StatelessWidget {
const DecoratedContainer({
Key? key,
this.color,
this.borderColor = Colors.transparent,
this.borderWidth = 0,
this.borderRadius = 0,
this.width,
this.height,
this.child,
class MyFoo extends StatefulWidget {
const MyFoo({Key? key, required this.child}) : super(key: key);
final Widget child;
@override
MyFooState createState() => MyFooState();
static MyFooState of(BuildContext context) =>
(context.dependOnInheritedWidgetOfExactType<_MyInheritedFoo>() as _MyInheritedFoo).state;