This file contains 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
void main() { | |
Provider.debugCheckInvalidValueType = null; | |
runApp(MyAppExample()); | |
} | |
class MyAppExample extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: MultiProvider(providers: [ |
This file contains 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'; | |
class ListViewWithExtraElements<T> extends StatelessWidget { | |
final List<T> elements; | |
final List<Widget> leadingElements; | |
final List<Widget> trailingElements; | |
final Widget Function(BuildContext context, T element) itemBuilder; | |
ListViewWithExtraElements({ | |
this.leadingElements = const [], |
This file contains 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
NeumorphicBar( | |
width: 200, | |
height: 400, | |
value: 0.9, | |
text: 'Tue', | |
color: Color.fromRGBO(0, 200, 156, 1), | |
), | |
class NeumorphicBar extends StatelessWidget { | |
const NeumorphicBar({ |
This file contains 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
GetIt supports since recently a mechanic to make initialization of registered | |
Instances easier. | |
The idea is that you can mark Singletons/LazySingletons that they will signal | |
when they are ready. | |
You then can wait for either that all are ready or that one of them is ready or | |
trigger the readyFuture manually | |
In case of a timeout you get detailed debug information. |
This file contains 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
void main() { | |
runApp(_SwitchingThemeApp()); | |
} | |
/// Properties that help me keep track of the example being run. | |
bool _useMaterial = false; | |
class _SwitchingThemeApp extends StatefulWidget { | |
@override | |
_SwitchingThemeAppState createState() => _SwitchingThemeAppState(); |
This file contains 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(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Draggable Custom Painter', | |
home: Scaffold( |
This file contains 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
/* | |
This example uses the following packages: | |
firebase_auth: 0.14.0+5 | |
google_sign_in: 4.0.7 | |
provider: 3.1.0+1 | |
Make sure you have setup your project with Firebase by following these instructions: | |
1. Follow Option 1 instructions here up to Step 3 |
This file contains 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
// MIT License | |
// | |
// Copyright (c) 2019 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains 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:core'; | |
import 'dart:io'; | |
main() { | |
final packageName = Directory.current.path.split('/').last; | |
final generated = new Directory('.dart_tool/build/generated/$packageName'); | |
// The build system's documentation reads "[e]mit .module assets which contain | |
// a filtered view of the package level meta-module specific to a single |
NewerOlder