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:math'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/rendering.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
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); | |
| // This widget is the root of your application. | |
| @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
| 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 'dart:io'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:image_picker/image_picker.dart'; | |
| class ImagePickerField extends StatefulWidget { | |
| const ImagePickerField({Key? key}) : super(key: key); | |
| @override | |
| State<ImagePickerField> createState() => _ImagePickerFieldState(); | |
| } |
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 MyHomePage extends StatefulWidget { | |
| const MyHomePage({super.key, required this.title}); | |
| final String title; | |
| @override | |
| State<MyHomePage> createState() => _MyHomePageState(); | |
| } | |
| class _MyHomePageState extends State<MyHomePage> { |
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 ImagePickerFormField extends FormField<File?> { | |
| ImagePickerFormField({ | |
| super.key, | |
| ImagePickerInputController? controller, | |
| ValueChanged<File?>? onChanged, | |
| super.validator, | |
| super.autovalidateMode, | |
| }) : super( | |
| initialValue: controller?.value, | |
| builder: (state) { |
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
| ImagePickerFormField( | |
| validator: (imageFile) { | |
| if (imageFile == null) return 'Please select an image'; | |
| return null; | |
| }, | |
| ), |
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
| name: form_widget_demo | |
| description: A new Flutter project. | |
| publish_to: 'none' # Remove this line if you wish to publish to pub.dev | |
| version: 1.0.0+1 | |
| environment: | |
| sdk: '>=3.0.5 <4.0.0' | |
| dependencies: |
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 RoundLinearProgress extends StatelessWidget { | |
| const RoundLinearProgress({super.key, double progress = 0}) | |
| : _progress = progress, | |
| assert( | |
| progress >= 0 && progress <= 100, | |
| 'indicator progress must be between 0 and 100', | |
| ); | |
| final double _progress; |
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 AnimatedDotsProgress extends StatefulWidget { | |
| const AnimatedDotsProgress({super.key, this.length = 3}); | |
| final int length; | |
| @override | |
| State<AnimatedDotsProgress> createState() => _AnimatedDotsProgressState(); | |
| } | |
| class _AnimatedDotsProgressState extends State<AnimatedDotsProgress> |