mirror of
https://github.com/Iconica-Development/flutter_input_library.git
synced 2025-05-18 17:03:45 +02:00
Merge pull request #42 from Iconica-Development/feature/styling
feat: add style to FlutterFormInputMultiLine
This commit is contained in:
commit
5bee01e304
35 changed files with 6234 additions and 6223 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
## 3.6.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
|
## 3.5.0
|
||||||
* Added `selectableTimePredicate` to the `DateTimeInputField` constructor
|
* Added `selectableTimePredicate` to the `DateTimeInputField` constructor
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ packages:
|
||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "3.3.1"
|
version: "3.6.0"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -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 CarouselController {
|
abstract class FlutterInputCarouselController {
|
||||||
factory CarouselController() => CarouselControllerImpl();
|
factory FlutterInputCarouselController() => CarouselControllerImpl();
|
||||||
bool get ready;
|
bool get ready;
|
||||||
|
|
||||||
Future<void> get onReady;
|
Future<void> get onReady;
|
||||||
|
@ -28,7 +28,7 @@ abstract class CarouselController {
|
||||||
void stopAutoPlay();
|
void stopAutoPlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
class CarouselControllerImpl implements CarouselController {
|
class CarouselControllerImpl implements FlutterInputCarouselController {
|
||||||
final Completer<void> _readyCompleter = Completer<void>();
|
final Completer<void> _readyCompleter = Completer<void>();
|
||||||
|
|
||||||
CarouselState? _state;
|
CarouselState? _state;
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -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 }
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
CarouselController? carouselController,
|
FlutterInputCarouselController? 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
|
||||||
: CarouselController() as CarouselControllerImpl;
|
: FlutterInputCarouselController() 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,
|
||||||
CarouselController? carouselController,
|
FlutterInputCarouselController? carouselController,
|
||||||
super.key,
|
super.key,
|
||||||
}) : items = null,
|
}) : items = null,
|
||||||
_carouselController = carouselController != null
|
_carouselController = carouselController != null
|
||||||
? carouselController as CarouselControllerImpl
|
? carouselController as CarouselControllerImpl
|
||||||
: CarouselController() as CarouselControllerImpl;
|
: FlutterInputCarouselController() as CarouselControllerImpl;
|
||||||
|
|
||||||
/// [CarouselOptions] to create a [CarouselState] with.
|
/// [CarouselOptions] to create a [CarouselState] with.
|
||||||
final CarouselOptions options;
|
final CarouselOptions options;
|
||||||
|
@ -81,6 +81,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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({
|
||||||
|
@ -65,7 +65,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,9 +97,10 @@ 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,
|
||||||
|
@ -110,19 +111,20 @@ class _DateInputFieldState extends State<DateTimeInputField> {
|
||||||
userInput = unformatted != null
|
userInput = unformatted != null
|
||||||
? widget.dateFormat.format(unformatted)
|
? widget.dateFormat.format(unformatted)
|
||||||
: userInput;
|
: 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,
|
||||||
|
@ -145,13 +147,14 @@ 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,
|
||||||
|
@ -164,9 +167,8 @@ class _DateInputFieldState extends State<DateTimeInputField> {
|
||||||
initialTime: initialTimeOfDay,
|
initialTime: initialTimeOfDay,
|
||||||
).then(
|
).then(
|
||||||
(value) => value == null
|
(value) => value == null
|
||||||
? ''
|
? ""
|
||||||
: MaterialLocalizations.of(context)
|
: locale.formatTimeOfDay(value, alwaysUse24HourFormat: true),
|
||||||
.formatTimeOfDay(value, alwaysUse24HourFormat: true),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,12 +187,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,
|
||||||
|
@ -199,7 +201,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,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import 'package:flutter/material.dart';
|
import "package:flutter/material.dart";
|
||||||
|
|
||||||
class FlutterFormInputDropdown extends StatelessWidget {
|
class FlutterFormInputDropdown extends StatelessWidget {
|
||||||
const FlutterFormInputDropdown({
|
const FlutterFormInputDropdown({
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
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 "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";
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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
|
@ -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}"),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
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({
|
||||||
|
@ -18,7 +18,7 @@ class RadioPicker extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _RadioPickerState extends State<RadioPicker> {
|
class _RadioPickerState extends State<RadioPicker> {
|
||||||
late var value = widget.initialValue;
|
late RadioItem? value = widget.initialValue;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => Wrap(
|
Widget build(BuildContext context) => Wrap(
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -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>[];
|
||||||
|
|
|
@ -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({
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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> {
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,6 +96,7 @@ 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;
|
||||||
|
@ -113,12 +114,14 @@ 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,
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
export 'validators/validators.dart';
|
export "validators/validators.dart";
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
export 'email/email.dart';
|
export "email/email.dart";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: flutter_input_library
|
name: flutter_input_library
|
||||||
description: A new Flutter package project.
|
description: A new Flutter package project.
|
||||||
version: 3.5.0
|
version: 3.6.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
|
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||||
|
@ -21,6 +21,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: 6.0.0
|
ref: 7.0.0
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
|
|
Loading…
Reference in a new issue