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
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
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
// 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
// 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
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
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
/// 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 Benchmark extends StatefulWidget { | |
const Benchmark({Key? key}) : super(key: key); | |
@override | |
_BenchmarkState createState() => _BenchmarkState(); | |
} | |
class _BenchmarkState extends State<Benchmark> { | |
double _tweenSliderValue = .2; | |
bool _enableRendering = false; | |
bool _useGTween = false; |
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
/// 1. The public facing widget, configuration options live here | |
class MyWidget extends StatefulWidget { | |
@override | |
_MyWidgetState createState() => _MyWidgetState(); | |
} | |
/// 2. The state / controller / bloc / view controller | |
/// event handlers and helper methods can live here | |
class _MyWidgetState extends State<MyWidget> { | |
void _handlePressed() => print('todo'); | |
@override |