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:flutter/services.dart'; | |
| class CardInputFormatter extends TextInputFormatter { | |
| CardInputFormatter({required this.separator, this.splitAt = 4}); | |
| final String separator; | |
| final int splitAt; | |
| @override | |
| TextEditingValue formatEditUpdate( |
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 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
| class ReadMoreWithMention extends StatefulWidget { | |
| final String text; | |
| final TextStyle? textStyle; | |
| final String readMoreText; | |
| final TextStyle? readMoreTextStyle; | |
| final int maxLines; | |
| final int steps; | |
| // final bool shouldUseSteps; | |
| const ReadMoreWithMention({ | |
| 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 ResizingCard extends StatefulWidget { | |
| const ResizingCard({Key? key, this.onClose}) : super(key: key); | |
| final VoidCallback? onClose; | |
| @override | |
| State<ResizingCard> createState() => _ResizingCardState(); | |
| } | |
| class _ResizingCardState extends State<ResizingCard> |
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 CustomTrackShape extends RoundedRectSliderTrackShape { | |
| @override | |
| Rect getPreferredRect( | |
| {required RenderBox parentBox, | |
| Offset offset = Offset.zero, | |
| required SliderThemeData sliderTheme, | |
| bool isEnabled = false, | |
| bool isDiscrete = false}) { |
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/gestures.dart'; | |
| import 'package:flutter/material.dart'; | |
| class ReadMore extends StatefulWidget { | |
| final String text; | |
| final TextStyle? textStyle; | |
| final String readMoreText; | |
| final TextStyle? readMoreTextStyle; | |
| final int maxLines; | |
| final int steps; |
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 CustomThumbShape extends SliderComponentShape { | |
| final double thumbRadius; | |
| const CustomThumbShape({ | |
| required this.thumbRadius, | |
| }); |
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
| /// Determine the current position of the device. | |
| /// | |
| /// When the location services are not enabled or permissions | |
| /// are denied the `Future` will return an error. | |
| Future<Position> _determinePosition() async { | |
| bool serviceEnabled; | |
| LocationPermission permission; | |
| // Test if location services are enabled. | |
| serviceEnabled = await Geolocator.isLocationServiceEnabled(); |
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); | |
| final List<Product> products = [ | |
| Product(name: 'Potato', quantity: '100', value: 1000), | |
| Product(name: 'Pie', quantity: '100', value: 1500), | |
| ]; |