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() { | |
| var dummyData = { | |
| 'name': 'Umesh Basnet', | |
| 'date':'2019-08-15T11:28:49.703' | |
| }; | |
| Test test = Test.fromJson(dummyData); | |
| print(test.getFormattedText()); | |
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
| FormField<String>( | |
| autovalidateMode: AutovalidateMode.onUserInteraction, | |
| validator: (value) => | |
| (value?.isNotEmpty ?? false) ? null : "Cannot be null", | |
| onSaved: (value)=> customName = value, | |
| builder: (state) { | |
| return Column( | |
| crossAxisAlignment: CrossAxisAlignment.start, | |
| children: [ | |
| Row( |
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:custom_form_field/src/choose_option_screen.dart'; | |
| import 'package:flutter/cupertino.dart'; | |
| import 'package:flutter/material.dart'; | |
| class CustomDropDownFormField<T> extends FormField<T> { | |
| CustomDropDownFormField({ | |
| Key? key, | |
| required List<DropdownMenuItem<T>> items, | |
| FormFieldValidator<T>? validator, | |
| Widget? hintText, |
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
| CustomDropDownFormField<String>( | |
| validator: (value) => | |
| (value?.isNotEmpty ?? false) ? null : "Cannot be null", | |
| items: AppConstant.timeOptions | |
| .map((e) => DropdownMenuItem( | |
| child: Text(e), | |
| value: e, | |
| )) | |
| .toList(), | |
| ) |
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() { | |
| final start = DateTime.now(); | |
| var a = findRepeatationOfCharacter('aaassdsdssasdasda'); | |
| final end = DateTime.now(); | |
| print(end.difference(start).inMilliseconds ); | |
| print(end.difference(start).inMicroseconds ); | |
| print(a); | |
| } |
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 $WidgetName$ extends StatelessWidget { | |
| const $WidgetName$({super.key}); | |
| @override | |
| Widget build(BuildContext context) { | |
| return Container($END$); | |
| } |