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:email_validator/email_validator.dart'; | |
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/material.dart' as material; | |
import 'package:intl/intl.dart'; | |
import 'package:rxdart/rxdart.dart'; | |
extension BuildContextExtensions on BuildContext { | |
dynamic get arguments => ModalRoute.of(this).settings.arguments; |
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 AppStyle { | |
static double get paddingUnit => 16; | |
static TextStyle get text28 => TextStyle(fontSize: 28).withTightSpacing; | |
static TextStyle get text20 => TextStyle(fontSize: 20).withTightSpacing; | |
static TextStyle get text16 => TextStyle(fontSize: 16).withNormalSpacing; | |
static TextStyle get text14 => TextStyle(fontSize: 14).withNormalSpacing; | |
static TextStyle get text12 => TextStyle(fontSize: 12).withWideSpacing; |
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:collection'; | |
import 'dart:convert' as convert; | |
import 'package:crypto/crypto.dart' as crypto; | |
import 'package:flutter_test/flutter_test.dart'; | |
main() { | |
testWidgets('Create, add, pass validate, tamper, fail validation', (_) async { | |
final blockchain = Blockchain(); | |
expect(blockchain.isValid, isTrue); |
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:flutter/material.dart'; | |
import 'package:material_theme/loading_notification/loading_image.dart'; | |
import 'package:material_theme/loading_notification/loading_notification_listener.dart'; | |
import 'package:material_theme/widgets/layout/default_scaffold.dart'; | |
import 'loading_future_builder.dart'; | |
class LoadingNotificationsRoute 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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.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
{ | |
"Freezed model": { | |
"prefix": "frz", | |
"body": [ | |
"import 'package:freezed_annotation/freezed_annotation.dart';", | |
"", | |
"part '$TM_FILENAME_BASE.freezed.dart';", | |
"", | |
"@freezed", | |
"abstract class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}} with _$${1} {", |
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
main() async { | |
print("Start"); | |
var s = Stopwatch()..start(); | |
/// It would be nice if getFoo() and getBar() were evaluated in parallel, | |
/// as if they were performed with Future.wait() | |
final result = Foo(await getFoo(), await getBar()); | |
print("Stop: ${s.elapsed}"); | |
} |
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
/// Alternative architecture for Flutter lifecycle methods. | |
/// | |
/// Currently the framework uses @mustCallSuper to ensure that | |
/// important operations are called when lifecycle methods are | |
/// overridden. However, it is a common source of confusion for | |
/// developers about if the super should be called before or after | |
/// their own code. | |
/// | |
/// This is a proposed alternative which has an internal `handleLifecycleMethod()` | |
/// method for each lifecycle event which calls `lifecycleMethod()` in the appropriate |
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:flutter_sandbox/widgets/layout/default_scaffold.dart'; | |
import 'package:flutter_sandbox/themes/text_themes.dart'; | |
class SandboxRoute extends StatefulWidget { | |
@override | |
_SandboxRouteState createState() => _SandboxRouteState(); | |
} | |
class _SandboxRouteState extends State<SandboxRoute> { |
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'; | |
class Table { | |
/// Example output | |
/// | |
/// ``` | |
/// Range (yd) 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 | |
/// Drop (in) -0.51, 0.06, 0.23, -0.03, -0.71, -1.84, -3.42, -5.46, -7.98, -10.99 | |
/// Drop (moa) 4.78, -0.31, -0.73, 0.06, 1.35, 2.92, 4.65, 6.51, 8.45, 10.48 | |
/// Windage (in) 0.03, 0.05, 0.09, 0.15, 0.22, 0.31, 0.41, 0.53, 0.66, 0.81 |