This file contains hidden or 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
/// 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()), |
This file contains hidden or 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 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; |
This file contains hidden or 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 os | |
org = "com.example" | |
name = "app_name" | |
cmd = "flutter create --org " + org + " --project-name " + name + " ."; | |
packages = [ | |
"cached_network_image", | |
"collection", | |
"copy_with_extension", | |
"equatable", |
This file contains hidden or 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
// 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( |
This file contains hidden or 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
// 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: [ |
This file contains hidden or 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 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
This file contains hidden or 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/material.dart'; | |
import 'package:flutter/services.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); |
This file contains hidden or 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 DeeplinkExample extends StatefulWidget { | |
@override | |
_DeeplinkExampleState createState() => _DeeplinkExampleState(); | |
} | |
class _DeeplinkExampleState extends State<DeeplinkExample> { | |
late NavStackController _controller; | |
@override | |
void initState() { |
This file contains hidden or 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 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, |
This file contains hidden or 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 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; |