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 MyHomePage extends StatefulWidget { | |
const MyHomePage({super.key, required this.title}); | |
final String title; | |
@override | |
State<MyHomePage> createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { |
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:io'; | |
import 'package:flutter/material.dart'; | |
import 'package:image_picker/image_picker.dart'; | |
class ImagePickerField extends StatefulWidget { | |
const ImagePickerField({Key? key}) : super(key: key); | |
@override | |
State<ImagePickerField> createState() => _ImagePickerFieldState(); | |
} |
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({super.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
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { |
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:math'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@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
/// A resuable widget for getting a page to refresh without needing to scroll with the ugly scroll behaviour | |
/// on ios. Used by wrapping the widget with the view with this widget as so | |
/// class MyHomePage extends StatelessWidget { | |
/// const MyHomePage({super.key, required this.title}); | |
/// | |
/// final String title; | |
/// | |
/// @override | |
/// Widget build(BuildContext context) { | |
/// return NoScrollRefreshWidget( |
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'; | |
typedef Lazy<T> = T Function(); | |
/// Represents a value of one of two possible types. | |
/// Instances of [Either] are either an instance of [Left] or [Right]. | |
/// | |
/// [Left] is used for "failure". | |
/// [Right] is used for "success". | |
abstract class Either<L, R> { |
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:math'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
final RegExp _mantissaSeparatorRegexp = RegExp(r'[,.]'); | |
final RegExp _illegalCharsRegexp = RegExp(r'[^\d-,.]+'); | |
class AmountInputFormatter implements TextInputFormatter { | |
final int mantissaLength; |
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
Future<Either<Exception, E>> firebaseTransform<E>( | |
Future<E> Function() callToStore) async { | |
try { | |
return Right(await callToStore.call()); | |
} on Exception catch (e) { | |
if (e is FirebaseException && e.code == 'permission-denied') { | |
return const Left( | |
AuthException('You have no permission to this resource')); | |
} | |
if (e is FirebaseException) { |
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 MyWidget extends StatefulWidget { | |
const MyWidget({super.key}); | |
@override | |
State<MyWidget> createState() => _MyWidgetState(); | |
} | |
class _MyWidgetState extends State<MyWidget> | |
with SingleTickerProviderStateMixin { | |
late final AnimationController controller; |