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
| "Generate a freezed union": { | |
| "prefix": "funion", | |
| "description": "Generate a freezed union", | |
| "body": [ | |
| "import 'package:freezed_annotation/freezed_annotation.dart';", | |
| "", | |
| "part '$TM_FILENAME_BASE.freezed.dart';", | |
| "", | |
| "@freezed", | |
| "abstract class $1 with _$$1 {", |
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/widgets.dart'; | |
| class ScaleBounceGesture extends StatefulWidget { | |
| final Widget child; | |
| final VoidCallback onPressed; | |
| final Duration duration; | |
| ScaleBounceGesture({ | |
| Key key, | |
| @required this.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
| git branch | grep -v "master" | xargs git branch -D |
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
| git reset $(git commit-tree HEAD^{tree} -m "A new start") |
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 TimestampSerializerPlugin implements SerializerPlugin { | |
| @override | |
| Object beforeSerialize(Object object, FullType specifiedType) { | |
| if (object is DateTime && specifiedType.root == DateTime) { | |
| return object.toUtc(); | |
| } | |
| return object; | |
| } | |
| @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/widgets.dart'; | |
| class FadeBetween extends StatelessWidget { | |
| /// Whether the first child is shown | |
| final bool condition; | |
| final Widget first; | |
| final Widget second; | |
| final Duration duration; | |
| const FadeBetween({ |
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:chewie/chewie.dart'; | |
| import 'package:flutter/material.dart'; | |
| class VideoPlayer extends StatelessWidget { | |
| final String url; | |
| final String filePath; | |
| final String assetPath; | |
| final bool showControls; | |
| const VideoPlayer({ |
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 Service { | |
| List<int> _list = []; | |
| final _controller = StreamController<int>(); | |
| Stream<List<int>> get myStream$ => _controller.stream; | |
| void addItem(int item){ | |
| _list.add(item); | |
| _controller.add(_list); | |
| } | |
| } |
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'; | |
| import 'package:grouped_buttons/grouped_buttons.dart'; | |
| class SelectCard extends StatelessWidget { | |
| final FormFieldValidator<String> validator; | |
| final void Function(String) onSelect; | |
| final List<String> options; | |
| final String selected; | |
| const SelectCard({ |
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:http/http.dart' as http; | |
| var request = new http.MultipartRequest("POST", url); | |
| request.fields['user'] = '[email protected]'; | |
| request.files.add(http.MultipartFile.fromPath( | |
| 'package', | |
| 'build/package.tar.gz', | |
| contentType: new MediaType('application', 'x-tar'), | |
| )); | |
| request.send().then((response) { |
NewerOlder