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 SquircleBorder extends ShapeBorder { | |
| final BorderSide side; | |
| final double superRadius; | |
| const SquircleBorder({this.side = BorderSide.none, this.superRadius = 0.0}); | |
| @override | |
| EdgeInsetsGeometry get dimensions => EdgeInsets.all(side.width); |
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
| /// https://dart.dev/language/patterns | |
| /// https://dart.dev/language/pattern-types | |
| /// https://dart.dev/language/branches#if-case | |
| void main() { | |
| final user = User(name: 'John', secondName: 'Doe', age: 20); | |
| final User(:name, :age) = user; | |
| print('Name: $name'); | |
| print('Age: $age'); |
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://api.flutter.dev/flutter/widgets/LocalHistoryRoute/addLocalHistoryEntry.html | |
| import 'package:flutter/material.dart'; | |
| void main(){ | |
| runApp(App()); | |
| } | |
| class App extends StatelessWidget { | |
| const App({super.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
| /* | |
| * Inherited get vs depend | |
| * https://https://gist.github.com/artembark/a72324442d5c8b0a315a02122343345a/ | |
| * https://dartpad.dev?id=a72324442d5c8b0a315a02122343345a | |
| */ | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp(const MyApp()); |
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 MyCustomClipper extends CustomClipper<Path> { | |
| @override | |
| Path getClip(Size size) { | |
| Path path_0 = Path(); | |
| path_0.moveTo(20,278); | |
| path_0.lineTo(20,32); | |
| path_0.cubicTo(20,25.3726,25.3726,20,32,20); | |
| path_0.lineTo(128.727,20); |
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() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); | |
| @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'; | |
| const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @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
| void main() async { | |
| print('Future API no return case:'); | |
| try { | |
| final result = await functionThatThrows().catchError((e) { | |
| print('Future API catchError fired with: $e'); | |
| }); | |
| if (result == true) { | |
| print('Flow continues with true result'); | |
| } else { | |
| print('Flow continues with else result'); |
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() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); | |
| @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'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); | |
| // This widget is the root of your application. |
NewerOlder