Compare commits

..

No commits in common. "master" and "3.3.0" have entirely different histories.

38 changed files with 6301 additions and 6482 deletions

View file

@ -1,14 +0,0 @@
name: Iconica Standard Component Release Workflow
# Workflow Caller version: 1.0.0
on:
release:
types: [published]
workflow_dispatch:
jobs:
call-global-iconica-workflow:
uses: Iconica-Development/.github/.github/workflows/component-release.yml@master
secrets: inherit
permissions: write-all

4
.gitignore vendored
View file

@ -35,7 +35,3 @@ example/windows
example/web example/web
example/android example/android
example/ios example/ios
# FVM Version Cache
.fvm/
.fvmrc

View file

@ -1,97 +1,83 @@
## 3.7.0 ## 0.0.1
* Added a 16 pixel padding between the `FlutterFormInputRadioPicker` items that is customizable with the `itemSpacing` parameter. * Initial release, retrieved inputs from flutter_form
## 3.6.0 ## 1.0.0
* Added style parameter to `FlutterFormInputMultiLine`
* Upgrade flutter_iconica_analysis to 7.0.0
* Changed the name of the `CarouselController` to `FlutterInputCarouselController`
## 3.5.0 * enforce 24h clock in the time picker because it can caused a bug on web
* Added `selectableTimePredicate` to the `DateTimeInputField` constructor
## 3.4.0 ## 1.0.1
* Added `FlutterFormInputDropdown`
## 3.3.1 * add decoration option for datetime input fields
* Loosened the dependen on intl to be more compatible with several Flutter versions
## 3.3.0 ## 1.0.3
* Added `FlutterFormInputRadioPicker`
* Changed the `FlutterFormInputNumberPicker` and added axis parameter.
* Changed the formating of the result value of the `showDateRangePicker`.
## 3.2.1 * add FocusNode option for input fields
* Added `PhoneNumber` model to save the `FlutterFormInputPhone` result.
* Added more customization for `FlutterFormInputPhone`.
## 3.2.0 ## 1.0.4
* Added `FlutterFormInputPhone` * fix datetimepicker format and validator
## 3.1.0 ## 1.0.5
* `FlutterFormInputPassword` now has the controller parameter to set the `TextEditingController` of the `TextFormField` * add style to datetime
## 3.0.0 ## 1.0.6
* Updated the FlutterFormInputSwitch to FlutterFormInputBool. This now includes a parameter to either show a checkbox or switch * add initial timepicker parameter
## 2.7.1 ## 2.0.0
* Added Iconica CI and Iconica Linter * remove 'riverpod' dependency
## 2.7.0 ## 2.1.0
* Addition of 'decoration' parameter to 'FlutterFormInputPassword' * make compatible with flutter 3.10
## 2.2.0
* Dateformat optional on input from the user, defaulting to 24 hour format
## 2.6.1 ## 2.2.1
* Addition of 'obscureText' parameter to 'FlutterFormInputPlainText' * Initial time optional on input from the user, defaulting to current time
## 2.6.0 ## 2.3.0
* Addition of the `textCapitalization` parameter to `FlutterFormInputPlainText` and `FlutterFormInputMultiLine`. * The ability to set the enabled parameter of TextFormFields
## 2.5.2
* Addition of `style` parameter to `FlutterFormInputPassword` widget.
## 2.5.1
* Addition of `formatInputs` parameter to `FlutterFormInputPlainText` widget.
* Addition of `formatInputs` parameter to `FlutterFormInputPassword` widget.
## 2.5.0
* Addition of the ScrollPicker input field.
## 2.4.0 ## 2.4.0
* The ability to disable the onTap paramater of the DatePicker * The ability to disable the onTap paramater of the DatePicker
* FlutterFormInputDateTime now also had the enabled parameter to provide to DateTimeInputField * FlutterFormInputDateTime now also had the enabled parameter to provide to DateTimeInputField
## 2.3.0 ## 2.5.0
* The ability to set the enabled parameter of TextFormFields * Addition of the ScrollPicker input field.
## 2.2.1 ## 2.5.1
* Initial time optional on input from the user, defaulting to current time * Addition of `formatInputs` parameter to `FlutterFormInputPlainText` widget.
* Addition of `formatInputs` parameter to `FlutterFormInputPassword` widget.
## 2.2.0 ## 2.5.2
* Dateformat optional on input from the user, defaulting to 24 hour format * Addition of `style` parameter to `FlutterFormInputPassword` widget.
## 2.1.0 ## 2.6.0
* make compatible with flutter 3.10 * Addition of the `textCapitalization` parameter to `FlutterFormInputPlainText` and `FlutterFormInputMultiLine`.
## 2.0.0 ## 2.6.1
* remove 'riverpod' dependency * Addition of 'obscureText' parameter to 'FlutterFormInputPlainText'
## 1.0.6 ## 2.7.0
* add initial timepicker parameter * Addition of 'decoration' parameter to 'FlutterFormInputPassword'
## 1.0.5 ## 2.7.1
* add style to datetime * Added Iconica CI and Iconica Linter
## 1.0.4 ## 3.0.0
* fix datetimepicker format and validator * Updated the FlutterFormInputSwitch to FlutterFormInputBool. This now includes a parameter to either show a checkbox or switch
## 1.0.3 ## 3.1.0
* add FocusNode option for input fields * `FlutterFormInputPassword` now has the controller parameter to set the `TextEditingController` of the `TextFormField`
## 1.0.1 ## 3.2.0
* add decoration option for datetime input fields * Added `FlutterFormInputPhone`
## 1.0.0 ## 3.2.1
* enforce 24h clock in the time picker because it can caused a bug on web * Added `PhoneNumber` model to save the `FlutterFormInputPhone` result.
* Added more customization for `FlutterFormInputPhone`.
## 0.0.1 ## 3.3.0
* Initial release, retrieved inputs from flutter_form * Added `FlutterFormInputRadioPicker`
* Changed the `FlutterFormInputNumberPicker` and added axis parameter.
* Changed the formating of the result value of the `showDateRangePicker`.

View file

View file

@ -45,10 +45,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.8" version: "1.0.5"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
@ -68,15 +68,15 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "3.6.0" version: "3.2.0"
flutter_lints: flutter_lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.3" version: "2.0.1"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -86,74 +86,50 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: intl name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.19.0" version: "0.18.1"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
lints: lints:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.16+1" version: "0.12.16"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.8.0" version: "0.5.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.12.0" version: "1.10.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.0" version: "1.8.3"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -203,10 +179,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.0" version: "0.6.1"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -215,14 +191,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.4" version: "2.1.4"
vm_service: web:
dependency: transitive dependency: transitive
description: description:
name: vm_service name: web
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "14.2.1" version: "0.3.0"
sdks: sdks:
dart: ">=3.3.0 <4.0.0" dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=3.18.0-18.0.pre.54" flutter: ">=1.17.0"

View file

@ -4,5 +4,5 @@
/// A library for creating input fields in Flutter. /// A library for creating input fields in Flutter.
library flutter_input_library; library flutter_input_library;
export "src/inputs/inputs.dart"; export 'src/inputs/inputs.dart';
export "src/utils/utils.dart"; export 'src/utils/utils.dart';

View file

@ -4,9 +4,9 @@
// ignore_for_file: avoid_positional_boolean_parameters // ignore_for_file: avoid_positional_boolean_parameters
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/bool/bool_field.dart"; import 'package:flutter_input_library/src/inputs/bool/bool_field.dart';
class FlutterFormInputBool extends StatelessWidget { class FlutterFormInputBool extends StatelessWidget {
const FlutterFormInputBool({ const FlutterFormInputBool({

View file

@ -4,8 +4,8 @@
// ignore_for_file: avoid_positional_boolean_parameters // ignore_for_file: avoid_positional_boolean_parameters
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/flutter_input_library.dart"; import 'package:flutter_input_library/flutter_input_library.dart';
class BoolFormField extends FormField<bool> { class BoolFormField extends FormField<bool> {
BoolFormField({ BoolFormField({

View file

@ -2,9 +2,9 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/carousel/carousel_form.dart"; import 'package:flutter_input_library/src/inputs/carousel/carousel_form.dart';
class FlutterFormInputCarousel extends StatelessWidget { class FlutterFormInputCarousel extends StatelessWidget {
const FlutterFormInputCarousel({ const FlutterFormInputCarousel({

View file

@ -2,15 +2,15 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "dart:async"; import 'dart:async';
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/carousel/carousel_options.dart"; import 'package:flutter_input_library/src/inputs/carousel/carousel_options.dart';
import "package:flutter_input_library/src/inputs/carousel/carousel_state.dart"; import 'package:flutter_input_library/src/inputs/carousel/carousel_state.dart';
import "package:flutter_input_library/src/inputs/carousel/carousel_utils.dart"; import 'package:flutter_input_library/src/inputs/carousel/carousel_utils.dart';
abstract class FlutterInputCarouselController { abstract class CarouselController {
factory FlutterInputCarouselController() => CarouselControllerImpl(); factory CarouselController() => CarouselControllerImpl();
bool get ready; bool get ready;
Future<void> get onReady; Future<void> get onReady;
@ -28,7 +28,7 @@ abstract class FlutterInputCarouselController {
void stopAutoPlay(); void stopAutoPlay();
} }
class CarouselControllerImpl implements FlutterInputCarouselController { class CarouselControllerImpl implements CarouselController {
final Completer<void> _readyCompleter = Completer<void>(); final Completer<void> _readyCompleter = Completer<void>();
CarouselState? _state; CarouselState? _state;

View file

@ -2,8 +2,8 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/carousel/carousel_slider.dart"; import 'package:flutter_input_library/src/inputs/carousel/carousel_slider.dart';
class CarouselFormField extends FormField<int> { class CarouselFormField extends FormField<int> {
CarouselFormField({ CarouselFormField({

View file

@ -2,7 +2,7 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
enum CarouselPageChangedReason { timed, manual, controller } enum CarouselPageChangedReason { timed, manual, controller }

View file

@ -4,17 +4,17 @@
/// ///
library carousel_slider; library carousel_slider;
import "dart:async"; import 'dart:async';
import "package:flutter/gestures.dart"; import 'package:flutter/gestures.dart';
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/carousel/carousel_controller.dart"; import 'package:flutter_input_library/src/inputs/carousel/carousel_controller.dart';
import "package:flutter_input_library/src/inputs/carousel/carousel_options.dart"; import 'package:flutter_input_library/src/inputs/carousel/carousel_options.dart';
import "package:flutter_input_library/src/inputs/carousel/carousel_state.dart"; import 'package:flutter_input_library/src/inputs/carousel/carousel_state.dart';
import "package:flutter_input_library/src/inputs/carousel/carousel_utils.dart"; import 'package:flutter_input_library/src/inputs/carousel/carousel_utils.dart';
export "carousel_controller.dart"; export 'carousel_controller.dart';
export "carousel_options.dart"; export 'carousel_options.dart';
typedef ExtendedIndexedWidgetBuilder = Widget Function( typedef ExtendedIndexedWidgetBuilder = Widget Function(
BuildContext context, BuildContext context,
@ -26,25 +26,25 @@ class CarouselSlider extends StatefulWidget {
CarouselSlider({ CarouselSlider({
required this.items, required this.items,
required this.options, required this.options,
FlutterInputCarouselController? carouselController, CarouselController? carouselController,
super.key, super.key,
}) : itemBuilder = null, }) : itemBuilder = null,
itemCount = items != null ? items.length : 0, itemCount = items != null ? items.length : 0,
_carouselController = carouselController != null _carouselController = carouselController != null
? carouselController as CarouselControllerImpl ? carouselController as CarouselControllerImpl
: FlutterInputCarouselController() as CarouselControllerImpl; : CarouselController() as CarouselControllerImpl;
/// The on demand item builder constructor/ /// The on demand item builder constructor/
CarouselSlider.builder({ CarouselSlider.builder({
required this.itemCount, required this.itemCount,
required this.itemBuilder, required this.itemBuilder,
required this.options, required this.options,
FlutterInputCarouselController? carouselController, CarouselController? carouselController,
super.key, super.key,
}) : items = null, }) : items = null,
_carouselController = carouselController != null _carouselController = carouselController != null
? carouselController as CarouselControllerImpl ? carouselController as CarouselControllerImpl
: FlutterInputCarouselController() as CarouselControllerImpl; : CarouselController() as CarouselControllerImpl;
/// [CarouselOptions] to create a [CarouselState] with. /// [CarouselOptions] to create a [CarouselState] with.
final CarouselOptions options; final CarouselOptions options;
@ -81,7 +81,6 @@ class CarouselSliderState extends State<CarouselSlider>
/// [mode] is related to why the page is being changed. /// [mode] is related to why the page is being changed.
CarouselPageChangedReason mode = CarouselPageChangedReason.controller; CarouselPageChangedReason mode = CarouselPageChangedReason.controller;
// ignore: use_setters_to_change_properties
void changeMode(CarouselPageChangedReason mode) { void changeMode(CarouselPageChangedReason mode) {
this.mode = mode; this.mode = mode;
} }

View file

@ -2,8 +2,8 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/carousel/carousel_slider.dart"; import 'package:flutter_input_library/src/inputs/carousel/carousel_slider.dart';
class CarouselState { class CarouselState {
CarouselState( CarouselState(

View file

@ -2,9 +2,9 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/date_picker/date_picker_field.dart"; import 'package:flutter_input_library/src/inputs/date_picker/date_picker_field.dart';
import "package:intl/intl.dart"; import 'package:intl/intl.dart';
enum FlutterFormDateTimeType { enum FlutterFormDateTimeType {
date, date,
@ -36,7 +36,6 @@ class FlutterFormInputDateTime extends StatelessWidget {
this.timePickerEntryMode = TimePickerEntryMode.dial, this.timePickerEntryMode = TimePickerEntryMode.dial,
this.enabled = true, this.enabled = true,
this.onTapEnabled = true, this.onTapEnabled = true,
this.selectableTimePredicate,
}); });
final TextStyle? style; final TextStyle? style;
final InputDecoration? decoration; final InputDecoration? decoration;
@ -58,7 +57,6 @@ class FlutterFormInputDateTime extends StatelessWidget {
final TimePickerEntryMode timePickerEntryMode; final TimePickerEntryMode timePickerEntryMode;
final bool enabled; final bool enabled;
final bool onTapEnabled; final bool onTapEnabled;
final bool Function(DateTime)? selectableTimePredicate;
@override @override
Widget build(BuildContext context) => DateTimeInputField( Widget build(BuildContext context) => DateTimeInputField(
@ -82,6 +80,5 @@ class FlutterFormInputDateTime extends StatelessWidget {
timePickerEntryMode: timePickerEntryMode, timePickerEntryMode: timePickerEntryMode,
enabled: enabled, enabled: enabled,
onTapEnabled: onTapEnabled, onTapEnabled: onTapEnabled,
selectableDayPredicate: selectableTimePredicate,
); );
} }

View file

@ -2,11 +2,11 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "dart:async"; import 'dart:async';
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/date_picker/date_picker.dart"; import 'package:flutter_input_library/src/inputs/date_picker/date_picker.dart';
import "package:intl/intl.dart"; import 'package:intl/intl.dart';
class DateTimeInputField extends StatefulWidget { class DateTimeInputField extends StatefulWidget {
const DateTimeInputField({ const DateTimeInputField({
@ -31,7 +31,6 @@ class DateTimeInputField extends StatefulWidget {
this.validator, this.validator,
this.enabled = true, this.enabled = true,
this.onTapEnabled = true, this.onTapEnabled = true,
this.selectableDayPredicate,
}); });
final TextStyle? style; final TextStyle? style;
final InputDecoration? decoration; final InputDecoration? decoration;
@ -53,7 +52,6 @@ class DateTimeInputField extends StatefulWidget {
final TimePickerEntryMode timePickerEntryMode; final TimePickerEntryMode timePickerEntryMode;
final bool enabled; final bool enabled;
final bool onTapEnabled; final bool onTapEnabled;
final bool Function(DateTime)? selectableDayPredicate;
@override @override
State<DateTimeInputField> createState() => _DateInputFieldState(); State<DateTimeInputField> createState() => _DateInputFieldState();
@ -65,7 +63,7 @@ class _DateInputFieldState extends State<DateTimeInputField> {
late final DateTime initialDate; late final DateTime initialDate;
late final DateTimeRange initialDateRange; late final DateTimeRange initialDateRange;
late final TimeOfDay? initialTime; late final TimeOfDay? initialTime;
String currentValue = ""; String currentValue = '';
@override @override
void initState() { void initState() {
@ -97,34 +95,31 @@ class _DateInputFieldState extends State<DateTimeInputField> {
FlutterFormDateTimeType inputType, [ FlutterFormDateTimeType inputType, [
DateFormat? dateFormat, DateFormat? dateFormat,
]) async { ]) async {
var userInput = ""; var userInput = '';
switch (inputType) { switch (inputType) {
case FlutterFormDateTimeType.date: case FlutterFormDateTimeType.date:
if (context.mounted) { var unformatted = await showDatePicker(
var unformatted = await showDatePicker( initialDate: initialDate,
initialDate: initialDate, context: context,
context: context, firstDate: firstDate,
firstDate: firstDate, lastDate: lastDate,
lastDate: lastDate, );
selectableDayPredicate: widget.selectableDayPredicate, userInput = unformatted != null
); ? widget.dateFormat.format(unformatted)
userInput = unformatted != null : userInput;
? widget.dateFormat.format(unformatted)
: userInput;
}
case FlutterFormDateTimeType.dateTime: case FlutterFormDateTimeType.dateTime:
await getInputFromUser(FlutterFormDateTimeType.date) await getInputFromUser(FlutterFormDateTimeType.date)
.then((value) async { .then((value) async {
if (value != "") { if (value != '') {
var secondInput = var secondInput =
await getInputFromUser(FlutterFormDateTimeType.time); await getInputFromUser(FlutterFormDateTimeType.time);
if (secondInput != "") { if (secondInput != '') {
var date = widget.dateFormat.parse(value); var date = widget.dateFormat.parse(value);
var time = dateFormat != null var time = dateFormat != null
? dateFormat.parse("01 01 1970 $secondInput") ? dateFormat.parse('01 01 1970 $secondInput')
: DateFormat("dd MM yyyy HH:mm") : DateFormat('dd MM yyyy HH:mm')
.parse("01 01 1970 $secondInput"); .parse('01 01 1970 $secondInput');
userInput = widget.dateFormat.format( userInput = widget.dateFormat.format(
DateTime( DateTime(
date.year, date.year,
@ -147,14 +142,13 @@ class _DateInputFieldState extends State<DateTimeInputField> {
initialDateRange: initialDateRange, initialDateRange: initialDateRange,
).then( ).then(
(value) => value != null (value) => value != null
? "${widget.dateFormat.format(value.start)} - " ? '${widget.dateFormat.format(value.start)} - '
"${widget.dateFormat.format(value.end)}" '${widget.dateFormat.format(value.end)}'
: "", : '',
); );
} }
case FlutterFormDateTimeType.time: case FlutterFormDateTimeType.time:
var locale = MaterialLocalizations.of(context);
if (context.mounted) { if (context.mounted) {
userInput = await showTimePicker( userInput = await showTimePicker(
initialEntryMode: widget.timePickerEntryMode, initialEntryMode: widget.timePickerEntryMode,
@ -167,8 +161,9 @@ class _DateInputFieldState extends State<DateTimeInputField> {
initialTime: initialTimeOfDay, initialTime: initialTimeOfDay,
).then( ).then(
(value) => value == null (value) => value == null
? "" ? ''
: locale.formatTimeOfDay(value, alwaysUse24HourFormat: true), : MaterialLocalizations.of(context)
.formatTimeOfDay(value, alwaysUse24HourFormat: true),
); );
} }
} }
@ -187,12 +182,12 @@ class _DateInputFieldState extends State<DateTimeInputField> {
? () async { ? () async {
var userInput = await getInputFromUser( var userInput = await getInputFromUser(
widget.inputType, widget.inputType,
DateFormat("dd MM yyyy HH:mm"), DateFormat('dd MM yyyy HH:mm'),
); );
setState(() { setState(() {
currentValue = userInput != "" ? userInput : currentValue; currentValue = userInput != '' ? userInput : currentValue;
widget.onChanged widget.onChanged
?.call(userInput != "" ? userInput : currentValue); ?.call(userInput != '' ? userInput : currentValue);
}); });
} }
: null, : null,
@ -201,7 +196,7 @@ class _DateInputFieldState extends State<DateTimeInputField> {
InputDecoration( InputDecoration(
suffixIcon: widget.showIcon ? Icon(widget.icon) : null, suffixIcon: widget.showIcon ? Icon(widget.icon) : null,
focusColor: Theme.of(context).primaryColor, focusColor: Theme.of(context).primaryColor,
label: widget.label ?? const Text("Date"), label: widget.label ?? const Text('Date'),
), ),
enabled: widget.enabled, enabled: widget.enabled,
); );

View file

@ -1,99 +0,0 @@
import "package:flutter/material.dart";
class FlutterFormInputDropdown extends StatelessWidget {
const FlutterFormInputDropdown({
this.alignment = AlignmentDirectional.centerStart,
this.autofocus = false,
this.isExpanded = false,
this.isDense = true,
this.iconSize = 24,
this.elevation = 8,
this.items,
this.selectedItemBuilder,
this.value,
this.hint,
this.disabledHint,
this.onChanged,
this.onTap,
this.style,
this.icon,
this.iconDisabledColor,
this.iconEnabledColor,
this.itemHeight,
this.focusColor,
this.focusNode,
this.dropdownColor,
this.decoration,
this.onSaved,
this.validator,
this.autovalidateMode,
this.menuMaxHeight,
this.enableFeedback,
this.borderRadius,
this.padding,
super.key,
});
final List<DropdownMenuItem<Object?>>? items;
final List<Widget> Function(BuildContext)? selectedItemBuilder;
final Object? value;
final Widget? hint;
final Widget? disabledHint;
final void Function(Object?)? onChanged;
final void Function()? onTap;
final int elevation;
final TextStyle? style;
final Widget? icon;
final Color? iconDisabledColor;
final Color? iconEnabledColor;
final double iconSize;
final bool isDense;
final bool isExpanded;
final double? itemHeight;
final Color? focusColor;
final FocusNode? focusNode;
final bool autofocus;
final Color? dropdownColor;
final InputDecoration? decoration;
final void Function(Object?)? onSaved;
final String? Function(Object?)? validator;
final AutovalidateMode? autovalidateMode;
final double? menuMaxHeight;
final bool? enableFeedback;
final AlignmentGeometry alignment;
final BorderRadius? borderRadius;
final EdgeInsetsGeometry? padding;
@override
Widget build(BuildContext context) => DropdownButtonFormField(
items: items,
selectedItemBuilder: selectedItemBuilder,
value: value,
hint: hint,
disabledHint: disabledHint,
onChanged: (value) => onChanged?.call(value),
onTap: () => onTap?.call(),
elevation: elevation,
style: style,
icon: icon,
iconDisabledColor: iconDisabledColor,
iconEnabledColor: iconEnabledColor,
iconSize: iconSize,
isDense: isDense,
isExpanded: isExpanded,
itemHeight: itemHeight,
focusColor: focusColor,
focusNode: focusNode,
autofocus: autofocus,
dropdownColor: dropdownColor,
decoration: decoration,
onSaved: (value) => onSaved?.call(value),
validator: (value) => validator?.call(value),
autovalidateMode: autovalidateMode,
menuMaxHeight: menuMaxHeight,
enableFeedback: enableFeedback,
alignment: alignment,
borderRadius: borderRadius,
padding: padding,
);
}

View file

@ -1,13 +1,12 @@
export "bool/bool.dart"; export 'bool/bool.dart';
export "carousel/carousel.dart"; export 'carousel/carousel.dart';
export "date_picker/date_picker.dart"; export 'date_picker/date_picker.dart';
export "dropdown/dropdown.dart"; export 'number_picker/number_picker.dart';
export "number_picker/number_picker.dart"; export 'phone/countries.dart';
export "phone/countries.dart"; export 'phone/phone.dart';
export "phone/phone.dart"; export 'phone/phone_number_model.dart';
export "phone/phone_number_model.dart"; export 'radio/radio_picker.dart';
export "radio/radio_picker.dart"; export 'scroll_picker/scroll_picker.dart';
export "scroll_picker/scroll_picker.dart"; export 'slider/slider.dart';
export "slider/slider.dart"; export 'text/password.dart';
export "text/password.dart"; export 'text/plain_text.dart';
export "text/plain_text.dart";

View file

@ -2,11 +2,11 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "dart:math" as math; import 'dart:math' as math;
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/number_picker/number_picker_field.dart"; import 'package:flutter_input_library/src/inputs/number_picker/number_picker_field.dart';
class DecimalNumberPicker extends StatelessWidget { class DecimalNumberPicker extends StatelessWidget {
const DecimalNumberPicker({ const DecimalNumberPicker({
@ -28,8 +28,8 @@ class DecimalNumberPicker extends StatelessWidget {
this.integerZeroPad = false, this.integerZeroPad = false,
this.integerDecoration, this.integerDecoration,
this.decimalDecoration, this.decimalDecoration,
}) : assert(minValue <= value, "value must be greater than minValue"), }) : assert(minValue <= value, 'value must be greater than minValue'),
assert(value <= maxValue, "value must be less than maxValue"); assert(value <= maxValue, 'value must be less than maxValue');
final int minValue; final int minValue;
final int maxValue; final int maxValue;
final double value; final double value;

View file

@ -2,12 +2,12 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "dart:math" as math; import 'dart:math' as math;
import "package:flutter/gestures.dart" show DragStartBehavior; import 'package:flutter/gestures.dart' show DragStartBehavior;
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter/rendering.dart"; import 'package:flutter/rendering.dart';
import "package:flutter/widgets.dart"; import 'package:flutter/widgets.dart';
/// Infinite ListView /// Infinite ListView
/// ///
@ -274,18 +274,18 @@ class InfiniteListViewState extends State<InfiniteListView> {
void debugFillProperties(DiagnosticPropertiesBuilder properties) { void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties); super.debugFillProperties(properties);
properties properties
.add(EnumProperty<Axis>("scrollDirection", widget.scrollDirection)); .add(EnumProperty<Axis>('scrollDirection', widget.scrollDirection));
properties.add( properties.add(
FlagProperty( FlagProperty(
"reverse", 'reverse',
value: widget.reverse, value: widget.reverse,
ifTrue: "reversed", ifTrue: 'reversed',
showName: true, showName: true,
), ),
); );
properties.add( properties.add(
DiagnosticsProperty<ScrollController>( DiagnosticsProperty<ScrollController>(
"controller", 'controller',
widget.controller, widget.controller,
showName: false, showName: false,
defaultValue: null, defaultValue: null,
@ -293,7 +293,7 @@ class InfiniteListViewState extends State<InfiniteListView> {
); );
properties.add( properties.add(
DiagnosticsProperty<ScrollPhysics>( DiagnosticsProperty<ScrollPhysics>(
"physics", 'physics',
widget.physics, widget.physics,
showName: false, showName: false,
defaultValue: null, defaultValue: null,
@ -301,16 +301,16 @@ class InfiniteListViewState extends State<InfiniteListView> {
); );
properties.add( properties.add(
DiagnosticsProperty<EdgeInsetsGeometry>( DiagnosticsProperty<EdgeInsetsGeometry>(
"padding", 'padding',
widget.padding, widget.padding,
defaultValue: null, defaultValue: null,
), ),
); );
properties.add( properties.add(
DoubleProperty("itemExtent", widget.itemExtent, defaultValue: null), DoubleProperty('itemExtent', widget.itemExtent, defaultValue: null),
); );
properties.add( properties.add(
DoubleProperty("cacheExtent", widget.cacheExtent, defaultValue: null), DoubleProperty('cacheExtent', widget.cacheExtent, defaultValue: null),
); );
} }
} }

View file

@ -2,9 +2,9 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/number_picker/number_picker_field.dart"; import 'package:flutter_input_library/src/inputs/number_picker/number_picker_field.dart';
class FlutterFormInputNumberPicker extends StatelessWidget { class FlutterFormInputNumberPicker extends StatelessWidget {
const FlutterFormInputNumberPicker({ const FlutterFormInputNumberPicker({
@ -16,7 +16,7 @@ class FlutterFormInputNumberPicker extends StatelessWidget {
this.initialValue, this.initialValue,
this.validator, this.validator,
this.axis = Axis.vertical, this.axis = Axis.vertical,
}) : assert(minValue < maxValue, "minValue must be less than maxValue"); }) : assert(minValue < maxValue, 'minValue must be less than maxValue');
final int minValue; final int minValue;
final int maxValue; final int maxValue;

View file

@ -2,11 +2,11 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "dart:async"; import 'dart:async';
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter/services.dart"; import 'package:flutter/services.dart';
import "package:flutter_input_library/src/inputs/number_picker/infinite_listview.dart"; import 'package:flutter_input_library/src/inputs/number_picker/infinite_listview.dart';
typedef TextMapper = String Function(String numberText); typedef TextMapper = String Function(String numberText);
@ -29,8 +29,8 @@ class NumberPicker extends StatefulWidget {
this.zeroPad = false, this.zeroPad = false,
this.textMapper, this.textMapper,
this.infiniteLoop = false, this.infiniteLoop = false,
}) : assert(minValue <= value, "value must be greater than minValue"), }) : assert(minValue <= value, 'value must be greater than minValue'),
assert(value <= maxValue, "value must be less than maxValue"); assert(value <= maxValue, 'value must be less than maxValue');
/// Min value user can pick /// Min value user can pick
final int minValue; final int minValue;
@ -248,7 +248,7 @@ class NumberPickerState extends State<NumberPicker> {
String _getDisplayedValue(int value) { String _getDisplayedValue(int value) {
var text = widget.zeroPad var text = widget.zeroPad
? value.toString().padLeft(widget.maxValue.toString().length, "0") ? value.toString().padLeft(widget.maxValue.toString().length, '0')
: value.toString(); : value.toString();
if (widget.textMapper != null) { if (widget.textMapper != null) {
return widget.textMapper!(text); return widget.textMapper!(text);

File diff suppressed because it is too large Load diff

View file

@ -3,9 +3,9 @@
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// ignore: depend_on_referenced_packages // ignore: depend_on_referenced_packages
import "package:collection/collection.dart"; import 'package:collection/collection.dart';
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/flutter_input_library.dart"; import 'package:flutter_input_library/flutter_input_library.dart';
class FlutterFormInputPhone extends StatefulWidget { class FlutterFormInputPhone extends StatefulWidget {
const FlutterFormInputPhone({ const FlutterFormInputPhone({
@ -20,7 +20,7 @@ class FlutterFormInputPhone extends StatefulWidget {
this.numberFieldStyle, this.numberFieldStyle,
this.dialCodeSelectorStyle, this.dialCodeSelectorStyle,
this.enabled = true, this.enabled = true,
this.priorityCountries = const ["NL", "BE", "LU"], this.priorityCountries = const ['NL', 'BE', 'LU'],
this.textAlignVertical = TextAlignVertical.top, this.textAlignVertical = TextAlignVertical.top,
this.dialCodeSelectorPadding = const EdgeInsets.only(top: 6), this.dialCodeSelectorPadding = const EdgeInsets.only(top: 6),
}); });
@ -82,7 +82,7 @@ class _FlutterFormInputPhoneState extends State<FlutterFormInputPhone> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var inputDecoration = widget.decoration ?? var inputDecoration = widget.decoration ??
InputDecoration( InputDecoration(
label: widget.label ?? const Text("Phone number"), label: widget.label ?? const Text('Phone number'),
); );
return FlutterFormInputPlainText( return FlutterFormInputPlainText(
@ -122,7 +122,7 @@ class _FlutterFormInputPhoneState extends State<FlutterFormInputPhone> {
const SizedBox( const SizedBox(
width: 4, width: 4,
), ),
Text("+${country.dialCode}"), Text('+${country.dialCode}'),
], ],
), ),
), ),

View file

@ -3,9 +3,9 @@
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
// ignore: depend_on_referenced_packages // ignore: depend_on_referenced_packages
import "package:collection/collection.dart"; import 'package:collection/collection.dart';
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/radio/radio_picker_field.dart"; import 'package:flutter_input_library/src/inputs/radio/radio_picker_field.dart';
class FlutterFormInputRadioPicker extends StatelessWidget { class FlutterFormInputRadioPicker extends StatelessWidget {
const FlutterFormInputRadioPicker({ const FlutterFormInputRadioPicker({
@ -14,21 +14,18 @@ class FlutterFormInputRadioPicker extends StatelessWidget {
this.onSaved, this.onSaved,
this.onChanged, this.onChanged,
this.initialValue, this.initialValue,
this.itemSpacing = 16.0,
}); });
final Function(RadioItem?)? onSaved; final Function(RadioItem?)? onSaved;
final String? initialValue; final String? initialValue;
final Function(RadioItem?)? onChanged; final Function(RadioItem?)? onChanged;
final List<RadioItem> items; final List<RadioItem> items;
final double itemSpacing;
@override @override
Widget build(BuildContext context) => RadioPickerFormField( Widget build(BuildContext context) => RadioPickerFormField(
onSaved: (value) => onSaved?.call(value), onSaved: (value) => onSaved?.call(value),
onChanged: (value) => onChanged?.call(value), onChanged: (value) => onChanged?.call(value),
initialValue: items.firstWhereOrNull((i) => i.value == initialValue), initialValue: items.firstWhereOrNull((i) => i.value == initialValue),
itemSpacing: itemSpacing,
items: items, items: items,
); );
} }
@ -37,7 +34,6 @@ class RadioPickerFormField extends FormField<RadioItem?> {
RadioPickerFormField({ RadioPickerFormField({
required FormFieldSetter<RadioItem> super.onSaved, required FormFieldSetter<RadioItem> super.onSaved,
required List<RadioItem> items, required List<RadioItem> items,
required double itemSpacing,
void Function(RadioItem value)? onChanged, void Function(RadioItem value)? onChanged,
super.initialValue, super.initialValue,
super.key, super.key,
@ -50,7 +46,6 @@ class RadioPickerFormField extends FormField<RadioItem?> {
}, },
items: items, items: items,
initialValue: initialValue, initialValue: initialValue,
itemSpacing: itemSpacing,
), ),
); );
} }

View file

@ -1,11 +1,10 @@
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/radio/radio_picker.dart"; import 'package:flutter_input_library/src/inputs/radio/radio_picker.dart';
class RadioPicker extends StatefulWidget { class RadioPicker extends StatefulWidget {
const RadioPicker({ const RadioPicker({
required this.onChanged, required this.onChanged,
required this.items, required this.items,
this.itemSpacing = 16.0,
this.initialValue, this.initialValue,
super.key, super.key,
}); });
@ -14,15 +13,12 @@ class RadioPicker extends StatefulWidget {
final Function(RadioItem) onChanged; final Function(RadioItem) onChanged;
final List<RadioItem> items; final List<RadioItem> items;
/// The spacing between each item.
final double itemSpacing;
@override @override
State<RadioPicker> createState() => _RadioPickerState(); State<RadioPicker> createState() => _RadioPickerState();
} }
class _RadioPickerState extends State<RadioPicker> { class _RadioPickerState extends State<RadioPicker> {
late RadioItem? value = widget.initialValue; late var value = widget.initialValue;
@override @override
Widget build(BuildContext context) => Wrap( Widget build(BuildContext context) => Wrap(
@ -46,9 +42,6 @@ class _RadioPickerState extends State<RadioPicker> {
), ),
], ],
), ),
if (widget.items.last != item) ...[
SizedBox(width: widget.itemSpacing),
],
], ],
], ],
); );

View file

@ -1,3 +1,3 @@
export "scroll_picker_decoration.dart"; export 'scroll_picker_decoration.dart';
export "scroll_picker_type_extensions.dart"; export 'scroll_picker_type_extensions.dart';
export "scroll_picker_widget.dart"; export 'scroll_picker_widget.dart';

View file

@ -2,7 +2,7 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
class ScrollPickerDecoration { class ScrollPickerDecoration {
const ScrollPickerDecoration({ const ScrollPickerDecoration({

View file

@ -2,8 +2,8 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/scroll_picker/scroll_picker_decoration.dart"; import 'package:flutter_input_library/src/inputs/scroll_picker/scroll_picker_decoration.dart';
class ScrollPicker extends StatefulWidget { class ScrollPicker extends StatefulWidget {
const ScrollPicker({ const ScrollPicker({

View file

@ -35,7 +35,7 @@ class TypeUtils {
WeekDay end, WeekDay end,
) { ) {
if (start.index > end.index) { if (start.index > end.index) {
throw ArgumentError("Start month must be before or equal to end month."); throw ArgumentError('Start month must be before or equal to end month.');
} }
var result = <DateTime>[]; var result = <DateTime>[];
@ -49,7 +49,7 @@ class TypeUtils {
/// Creates list of Datetime with the months from start to end. /// Creates list of Datetime with the months from start to end.
List<DateTime> createMonthList(Month start, Month end, {int? year}) { List<DateTime> createMonthList(Month start, Month end, {int? year}) {
if (start.index > end.index) { if (start.index > end.index) {
throw ArgumentError("Start month must be before or equal to end month."); throw ArgumentError('Start month must be before or equal to end month.');
} }
var result = <DateTime>[]; var result = <DateTime>[];
@ -65,7 +65,7 @@ class TypeUtils {
/// Creates a list of Datetime with the years from start to end. /// Creates a list of Datetime with the years from start to end.
List<DateTime> createYearList(int start, int end) { List<DateTime> createYearList(int start, int end) {
if (start > end) { if (start > end) {
throw ArgumentError("Start year must be before or equal to year month."); throw ArgumentError('Start year must be before or equal to year month.');
} }
var result = <DateTime>[]; var result = <DateTime>[];

View file

@ -2,9 +2,9 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/scroll_picker/scroll_picker_decoration.dart"; import 'package:flutter_input_library/src/inputs/scroll_picker/scroll_picker_decoration.dart';
import "package:flutter_input_library/src/inputs/scroll_picker/scroll_picker_field.dart"; import 'package:flutter_input_library/src/inputs/scroll_picker/scroll_picker_field.dart';
class FlutterFormInputScrollPicker<T> extends StatelessWidget { class FlutterFormInputScrollPicker<T> extends StatelessWidget {
const FlutterFormInputScrollPicker({ const FlutterFormInputScrollPicker({

View file

@ -2,8 +2,8 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter_input_library/src/inputs/slider/slider_field.dart"; import 'package:flutter_input_library/src/inputs/slider/slider_field.dart';
class FlutterFormInputSlider extends StatelessWidget { class FlutterFormInputSlider extends StatelessWidget {
const FlutterFormInputSlider({ const FlutterFormInputSlider({
@ -15,7 +15,7 @@ class FlutterFormInputSlider extends StatelessWidget {
this.initialValue, this.initialValue,
this.validator, this.validator,
this.focusNode, this.focusNode,
}) : assert(minValue < maxValue, "minValue must be less than maxValue"); }) : assert(minValue < maxValue, 'minValue must be less than maxValue');
final int minValue; final int minValue;
final int maxValue; final int maxValue;

View file

@ -2,7 +2,7 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
/// Creates a slider with the given input parameters /// Creates a slider with the given input parameters
class SliderFormField extends FormField<double> { class SliderFormField extends FormField<double> {

View file

@ -2,8 +2,8 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter/services.dart"; import 'package:flutter/services.dart';
/// Generates a [TextFormField] for passwords. It requires a /// Generates a [TextFormField] for passwords. It requires a
/// [FlutterFormInputController] as the [controller] parameter and an /// [FlutterFormInputController] as the [controller] parameter and an

View file

@ -2,8 +2,8 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
import "package:flutter/material.dart"; import 'package:flutter/material.dart';
import "package:flutter/services.dart"; import 'package:flutter/services.dart';
class FlutterFormInputPlainText extends StatelessWidget { class FlutterFormInputPlainText extends StatelessWidget {
const FlutterFormInputPlainText({ const FlutterFormInputPlainText({
@ -53,7 +53,7 @@ class FlutterFormInputPlainText extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var inputDecoration = decoration ?? var inputDecoration = decoration ??
InputDecoration( InputDecoration(
label: label ?? const Text("Plain text"), label: label ?? const Text('Plain text'),
); );
return TextFormField( return TextFormField(
@ -96,7 +96,6 @@ class FlutterFormInputMultiLine extends StatelessWidget {
this.validator, this.validator,
this.onFieldSubmitted, this.onFieldSubmitted,
this.textCapitalization = TextCapitalization.sentences, this.textCapitalization = TextCapitalization.sentences,
this.style,
}); });
final Widget? label; final Widget? label;
@ -114,14 +113,12 @@ class FlutterFormInputMultiLine extends StatelessWidget {
final Function(String?)? onChanged; final Function(String?)? onChanged;
final Function(String?)? onFieldSubmitted; final Function(String?)? onFieldSubmitted;
final TextCapitalization textCapitalization; final TextCapitalization textCapitalization;
final TextStyle? style;
@override @override
Widget build(BuildContext context) => Column( Widget build(BuildContext context) => Column(
children: [ children: [
Expanded( Expanded(
child: FlutterFormInputPlainText( child: FlutterFormInputPlainText(
style: style,
label: label, label: label,
textAlignVertical: TextAlignVertical.top, textAlignVertical: TextAlignVertical.top,
expands: true, expands: true,

View file

@ -2,4 +2,4 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
export "validators/validators.dart"; export 'validators/validators.dart';

View file

@ -2,4 +2,4 @@
// //
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
export "email/email.dart"; export 'email/email.dart';

View file

@ -1,19 +1,16 @@
name: flutter_input_library name: flutter_input_library
description: A new Flutter package project. description: A new Flutter package project.
version: 3.7.0 version: 3.3.0
repository: https://github.com/Iconica-Development/flutter_input_library repository: https://github.com/Iconica-Development/flutter_input_library
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub
environment: environment:
sdk: ">=3.0.0 <4.0.0" sdk: ^3.0.0
flutter: ">=1.17.0" flutter: ">=1.17.0"
dependencies: dependencies:
collection: ^1.18.0
flutter: flutter:
sdk: flutter sdk: flutter
intl: ">=0.18.0 <1.0.0" intl: ^0.18.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
@ -21,4 +18,6 @@ dev_dependencies:
flutter_iconica_analysis: flutter_iconica_analysis:
git: git:
url: https://github.com/Iconica-Development/flutter_iconica_analysis url: https://github.com/Iconica-Development/flutter_iconica_analysis
ref: 7.0.0 ref: 6.0.0
flutter: