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:animations/animations.dart'; | |
| import 'package:flutter/material.dart'; | |
| typedef WidgetBuilderWithCallback = Widget Function( | |
| BuildContext context, | |
| VoidCallback callback, | |
| ); | |
| void main() => runApp(const MaterialApp(home: ParallaxWidget())); |
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'; | |
| void main() => runApp(const MaterialApp(home: ParallaxWidget())); | |
| class ParallaxWidget extends StatelessWidget { | |
| final List<LocationItem> locations; | |
| const ParallaxWidget({ | |
| super.key, | |
| this.locations = LocationItems.all, | |
| }); |
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 'dart:math' show Random; | |
| import 'dart:ui' as ui; | |
| extension PathWrapperX on Path { | |
| PathWrapper wrap() => PathWrapper(this); | |
| } | |
| class PathWrapper { | |
| final Path path; |
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 'dart:math' show Random; | |
| import 'dart:ui' as ui; | |
| extension PathFromSizeX on Size { | |
| Path path(double c) => Path() | |
| ..moveTo(0, height * .5) | |
| ..quadraticBezierTo( | |
| width * c, | |
| height, |
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'; | |
| void main() => runApp( | |
| const MaterialApp( | |
| home: MyScaffold( | |
| tabs: [ | |
| MyColumn(), | |
| MyStack(), | |
| MyPositonedBottom(), | |
| MyPositonedTop(), |
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 'package:flutter/material.dart'; | |
| /// THIS IS TO INJECT SOMETHING THAT NEEDS TO BE INITIALIZED IN THE CONTEXT | |
| /// [[start]] | |
| typedef Initialize<T> = T Function(); | |
| typedef Dispose<T> = void Function(T); | |
| class _MyInheritedWidget<T> extends InheritedWidget { |
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'; | |
| const webp = 'https://im3.ezgif.com/tmp/ezgif-3-08c57e6f54.webp'; | |
| const gif = 'https://roszkowski.dev/images/2020-05-04/flutter_logo_leg.gif'; | |
| void main() => runApp( | |
| MaterialApp( | |
| home: Scaffold( | |
| body: Column( | |
| children: const [ |
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:go_router/go_router.dart'; | |
| void main() => runApp(const MyApp()); | |
| final _router = GoRouter( | |
| routes: <GoRoute>[ | |
| GoRoute( | |
| path: '/', | |
| builder: (context, _) => |
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:convert'; | |
| // import 'dart:math'; | |
| // import 'package:flutter/services.dart'; | |
| import 'package:flutter/material.dart'; | |
| const emoji = '💙'; | |
| void main() => runApp(const MaterialApp(home: MyHomePage())); | |
| class MyHomePage extends StatefulWidget { |
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
| final notDouble = .2.clamp(0, .1); | |
| void main() => print(notDouble.runtimeType); |