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'; | |
typedef BlocBuilder<T> = T Function(); | |
typedef BlocDisposer<T> = Function(T); | |
abstract class BlocBase { | |
void dispose(); | |
} | |
class BlocProvider<T extends BlocBase> extends StatefulWidget { |
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
class CustomTrianglePainter extends CustomPainter { | |
final Color color; | |
late Paint _paint; | |
CustomTrianglePainter(this.color) { | |
_paint = Paint() | |
..color = color | |
..style = PaintingStyle.fill; | |
} |
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(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override |
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:async'; | |
import 'dart:html' as html; | |
import 'dart:typed_data'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} |
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'; | |
import 'package:google_fonts/google_fonts.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
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/gestures.dart'; | |
import 'package:flutter/material.dart'; | |
Future<void> main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
runApp(App()); | |
} | |
class App extends StatefulWidget { | |
@override |
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:async'; | |
import 'package:rxdart/rxdart.dart'; | |
import 'package:sensors/sensors.dart'; | |
Stream<bool> isShaking() { | |
final timeout = Duration(milliseconds: 300); | |
final accelerationThreshold = 3; | |
final sampleInterval = Duration(milliseconds: 50); | |
final moveCountThreshold = 5; |
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
[ | |
{ | |
"brand": "iPhone", | |
"model": "11 Pro Max", | |
"width": 1242, | |
"height": 2688, | |
"physicalSize": 6.5, | |
"devicePixelRatio": 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
import 'package:flutter/material.dart'; | |
class Counter extends StatefulWidget { | |
_CounterState createState() => _CounterState(); | |
} | |
class _CounterState extends State<Counter> { | |
double val; | |
void initState() { |
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() async { | |
final numbers = FibonacciNumbers(); | |
runApp( | |
MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
appBar: AppBar( |
NewerOlder