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'; | |
| void main() async { | |
| runApp(App()); | |
| } | |
| class App extends StatelessWidget { | |
| const App({ | |
| Key key, | |
| }) : super(key: key); |
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 NotificationsAsyncLoadingAction extends Action { | |
| const NotificationsAsyncLoadingAction(); | |
| } | |
| class NotificationsAsyncSuccessAction extends Action { | |
| const NotificationsAsyncSuccessAction({ | |
| @required this.notifications, | |
| }); | |
| final List<NotificationModel> notifications; |
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:async'; | |
| import 'dart:convert'; | |
| import 'dart:typed_data'; | |
| import 'dart:ui' as ui; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/rendering.dart'; | |
| class WidgetToImage extends StatefulWidget { | |
| @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/services.dart'; | |
| import 'package:flutter/widgets.dart'; | |
| class StatusBar extends StatelessWidget { | |
| const StatusBar({ | |
| Key key, | |
| this.brightness = Brightness.dark, | |
| @required this.child, | |
| }) : super(key: key); |
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 OneTimeBuilder extends StatefulWidget { | |
| const OneTimeBuilder({ | |
| Key key, | |
| @required this.once, | |
| @required this.child, | |
| }) : assert(once != null), | |
| assert(child != null), | |
| super(key: key); |
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
| # From: https://github.com/flutter/flutter/blob/master/analysis_options.yaml | |
| # | |
| # Specify analysis options. | |
| # | |
| # Until there are meta linter rules, each desired lint must be explicitly enabled. | |
| # See: https://github.com/dart-lang/linter/issues/288 | |
| # | |
| # For a list of lints, see: http://dart-lang.github.io/linter/lints/ | |
| # See the configuration guide for more | |
| # https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer |
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 Bubble extends StatelessWidget { | |
| Bubble({this.message, this.time, this.delivered, this.isMe}); | |
| final String message, time; | |
| final delivered, isMe; | |
| @override | |
| Widget build(BuildContext context) { |
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
| const alphabet = "abcdefghijklmnopqrst"; | |
| const randomStr = Array(3) | |
| .fill(null) | |
| .map(() => Math.floor(Math.random() * alphabet.length)) | |
| .map(num => alphabet[num]) | |
| .join(""); | |
| let counter = 0; | |
| export function newId<T extends string>(prefix: string = "id") { | |
| return `${prefix}_${randomStr}_${counter++}` as 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 'package:flutter/widgets.dart'; | |
| class WaveCard extends StatelessWidget { | |
| WaveCard({Key key, padding: EdgeInsets}) : super(key: key); | |
| @override | |
| Widget build(BuildContext context) { | |
| final painter = WavePainter(Color.fromRGBO(96, 204, 184, 0.2)); | |
| return CustomPaint( | |
| painter: painter, |
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/cupertino.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/services.dart'; | |
| void main() => runApp(ExampleApp()); | |
| class ExampleApp extends StatefulWidget { | |
| @override | |
| _ExampleAppState createState() => _ExampleAppState(); | |
| } |