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'; | |
| class GrayedOut extends StatelessWidget { | |
| final Widget child; | |
| final bool grayedOut; | |
| GrayedOut({@required this.child, this.grayedOut = true}); | |
| @override |
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'; | |
| class GrayedOut extends StatelessWidget { | |
| final Widget child; | |
| final bool grayedOut; | |
| final double opacity; | |
| GrayedOut({@required this.child, this.grayedOut = true}) | |
| : opacity = grayedOut == true ? 0.3 : 1.0; |
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'; | |
| class Left extends StatelessWidget { | |
| final Widget child; | |
| Left({@required this.child}); | |
| @override | |
| Widget build(BuildContext context) { | |
| return Align(alignment: Alignment.centerLeft, child: child); |
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
| void main() { | |
| List<Future<Option>> options = [Future.value(Option(2)), Future.value(Option(3)), Future.value(Option(1))]; | |
| options.sort((lhs, rhs) => lhs.ordinal - rhs.ordinal); | |
| } | |
| class Option | |
| { |
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
| void main() async { | |
| // pretend I've just return the set of options from an REST call to the db | |
| List<RefOption> refs = [RefOption(2), RefOption(3), RefOption(1)]; | |
| await resolveList(refs); | |
| refs.sort((lhs, rhs) => lhs.option.ordinal - rhs.option.ordinal); | |
| for (RefOption ref in refs) |
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
| class IdRef<E extends Entity> { | |
| GUID guid; | |
| // Once the entity has been resolved we cache it here. | |
| E resolvedEntity; | |
| /// Creates an IdRef from a guid. | |
| /// | |
| /// Calling [future] will trigger the process | |
| /// to resolve the entity (i.e. do the network call) |
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
| class MyRepo | |
| { | |
| } | |
| class RealRepo<E extends Entity> | |
| { | |
| Repository<E> repo; | |
| } | |
| abstract class TypedEvent<T> |
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:core" as core show StackTrace; | |
| import "dart:core"; | |
| import 'dart:io'; | |
| import 'package:path/path.dart'; | |
| class StackTraceImpl implements core.StackTrace { | |
| static final stackTraceRegex = RegExp(r'#[0-9]+[\s]+(.+) \(([^\s]+)\)'); | |
| final core.StackTrace stackTrace; |
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
| #! /usr/bin/env dshell | |
| import 'package:dshell/dshell.dart'; | |
| void main() { | |
| print('Hello World'); | |
| } |
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
| chmod +x hello_world.dart | |
| ./hello_world.dart |
OlderNewer