Created with <3 with dartpad.dev.
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'; | |
| @immutable | |
| class ClipShadowPath extends StatelessWidget { | |
| final Shadow shadow; | |
| final CustomClipper<Path> clipper; | |
| final Widget child; | |
| ClipShadowPath({ | |
| @required this.shadow, |
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
| // Copyright 2019 the Dart project authors. 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(const MyApp()); | |
| class MyApp extends StatelessWidget { | |
| const MyApp({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
| #!/bin/sh | |
| # To run, download the script or copy the code to a '.sh' file (for example 'fluttercleanrecursive.sh') and run like any other script: | |
| # sh ./fluttercleanrecursive.sh | |
| # or | |
| # sudo sh fluttercleanrecursive.sh | |
| echo "Flutter Clean Recursive (by jeroen-meijer on GitHub Gist)" | |
| echo "Looking for projects... (may take a while)" |
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
| Future<void> downloadFile(String assetPath)async{ | |
| /// get the data from the asset file. | |
| final ByteData data = await rootBundle.load(assetPath); | |
| final List<int> bytes = data.buffer.asUint8List(); | |
| final directory = await getDownloadsDirectory(); | |
| /// get the file name & extension from the asset file. |
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
| // 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 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 Employee { | |
| String? name; | |
| double? salary; | |
| String? email; | |
| // default constructor | |
| // Employee(String na, double sal, String emai) { | |
| // name = na; | |
| // salary = sal; |
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
| main() { | |
| inc(shoppingCart[0], "red", "small"); | |
| inc(shoppingCart[0], "red", "small"); | |
| inc(shoppingCart[0], "red", "small"); | |
| inc(shoppingCart[0], "red", "small"); | |
| inc(shoppingCart[1], "red", "small"); | |
| inc(shoppingCart[2], "red", "small"); | |
| inc(shoppingCart[0], "red", "small"); | |
| inc(shoppingCart[0], "red", "small"); | |
| inc(shoppingCart[0], "red", "small"); |
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
| main() { | |
| inc(shoppingCart[0], "red", "small"); | |
| inc(shoppingCart[1], "red", "small"); | |
| inc(shoppingCart[2], "red", "small"); | |
| inc(shoppingCart[0], "red", "small"); | |
| inc(shoppingCart[0], "red", "small"); | |
| inc(shoppingCart[0], "red", "small"); | |
| inc(shoppingCart[0], "red", "small"); | |
| dec(shoppingCart[0], "red", "small"); |
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
| List<Map<String, dynamic>> shoppingCart = [ | |
| { | |
| 'name': 'Jeans', | |
| 'price': 160, | |
| 'availableQty': [ | |
| {"color": "red", "size": "small"} | |
| ], | |
| 'selectedQty': [ | |
| {"color": "red", "size": "small"} | |
| ], |