mirror of
https://github.com/Iconica-Development/flutter_form_wizard.git
synced 2025-05-19 10:53:49 +02:00
fix: add enabled property to FlutterFormInputPlainText and FlutterFormInputDateTime
This commit is contained in:
parent
9a2585de99
commit
82fcf5258a
8 changed files with 37 additions and 7 deletions
|
@ -95,4 +95,7 @@
|
||||||
- Bump `flutter_input_library` to version 2.3.0
|
- Bump `flutter_input_library` to version 2.3.0
|
||||||
|
|
||||||
## 6.1.5 - October 26th 2023
|
## 6.1.5 - October 26th 2023
|
||||||
- Bump `flutter_input_library` to version 2.4.0
|
- Bump `flutter_input_library` to version 2.4.0
|
||||||
|
|
||||||
|
## 6.1.6 - October 26th 2023
|
||||||
|
- Add enabled property to FlutterFormInputPlainText and FlutterFormInputDateTime
|
|
@ -68,7 +68,7 @@ packages:
|
||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "6.1.4"
|
version: "6.1.5"
|
||||||
flutter_input_library:
|
flutter_input_library:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -19,6 +19,7 @@ abstract class FlutterFormInputWidget<T> extends StatelessWidget {
|
||||||
required this.controller,
|
required this.controller,
|
||||||
this.focusNode,
|
this.focusNode,
|
||||||
this.label,
|
this.label,
|
||||||
|
this.enabled = true,
|
||||||
String? hintText,
|
String? hintText,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@ -30,6 +31,8 @@ abstract class FlutterFormInputWidget<T> extends StatelessWidget {
|
||||||
|
|
||||||
final FocusNode? focusNode;
|
final FocusNode? focusNode;
|
||||||
|
|
||||||
|
final bool enabled;
|
||||||
|
|
||||||
/// [registerController] should be called to register the given [controller] to the form page.
|
/// [registerController] should be called to register the given [controller] to the form page.
|
||||||
registerController(BuildContext context) {
|
registerController(BuildContext context) {
|
||||||
FlutterFormInputController? localController =
|
FlutterFormInputController? localController =
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
// ignore_for_file: overridden_fields, annotate_overrides
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
@ -24,6 +26,8 @@ class FlutterFormInputDateTime extends FlutterFormInputWidget<String> {
|
||||||
this.initialDate,
|
this.initialDate,
|
||||||
this.initialDateTimeRange,
|
this.initialDateTimeRange,
|
||||||
this.icon = Icons.calendar_today,
|
this.icon = Icons.calendar_today,
|
||||||
|
this.enabled = true,
|
||||||
|
this.onTapEnabled = true,
|
||||||
}) : super(
|
}) : super(
|
||||||
key: key,
|
key: key,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
|
@ -37,6 +41,8 @@ class FlutterFormInputDateTime extends FlutterFormInputWidget<String> {
|
||||||
final DateTime? firstDate;
|
final DateTime? firstDate;
|
||||||
final DateTime? lastDate;
|
final DateTime? lastDate;
|
||||||
final IconData icon;
|
final IconData icon;
|
||||||
|
final bool enabled;
|
||||||
|
final bool onTapEnabled;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -44,6 +50,8 @@ class FlutterFormInputDateTime extends FlutterFormInputWidget<String> {
|
||||||
super.registerController(context);
|
super.registerController(context);
|
||||||
|
|
||||||
return input.FlutterFormInputDateTime(
|
return input.FlutterFormInputDateTime(
|
||||||
|
enabled: enabled,
|
||||||
|
onTapEnabled: onTapEnabled,
|
||||||
label: label,
|
label: label,
|
||||||
icon: icon,
|
icon: icon,
|
||||||
firstDate: firstDate,
|
firstDate: firstDate,
|
||||||
|
|
|
@ -16,11 +16,13 @@ class FlutterFormInputEmail extends FlutterFormInputWidget<String> {
|
||||||
required FlutterFormInputController<String> controller,
|
required FlutterFormInputController<String> controller,
|
||||||
FocusNode? focusNode,
|
FocusNode? focusNode,
|
||||||
Widget? label,
|
Widget? label,
|
||||||
|
bool? enabled,
|
||||||
}) : super(
|
}) : super(
|
||||||
key: key,
|
key: key,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
label: label,
|
label: label,
|
||||||
|
enabled: enabled ?? true,
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -30,6 +32,7 @@ class FlutterFormInputEmail extends FlutterFormInputWidget<String> {
|
||||||
super.registerController(context);
|
super.registerController(context);
|
||||||
|
|
||||||
return input.FlutterFormInputPlainText(
|
return input.FlutterFormInputPlainText(
|
||||||
|
enabled: enabled,
|
||||||
initialValue: controller.value,
|
initialValue: controller.value,
|
||||||
onSaved: (value) {
|
onSaved: (value) {
|
||||||
controller.onSaved(value);
|
controller.onSaved(value);
|
||||||
|
|
|
@ -15,11 +15,14 @@ class FlutterFormInputPassword extends FlutterFormInputWidget<String> {
|
||||||
required FlutterFormInputController<String> controller,
|
required FlutterFormInputController<String> controller,
|
||||||
FocusNode? focusNode,
|
FocusNode? focusNode,
|
||||||
Widget? label,
|
Widget? label,
|
||||||
|
bool? enabled,
|
||||||
}) : super(
|
}) : super(
|
||||||
key: key,
|
key: key,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
label: label);
|
label: label,
|
||||||
|
enabled: enabled ?? true,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -28,6 +31,7 @@ class FlutterFormInputPassword extends FlutterFormInputWidget<String> {
|
||||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||||
|
|
||||||
return input.FlutterFormInputPassword(
|
return input.FlutterFormInputPassword(
|
||||||
|
enabled: enabled,
|
||||||
initialValue: controller.value,
|
initialValue: controller.value,
|
||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
onSaved: (value) => controller.onSaved(value),
|
onSaved: (value) => controller.onSaved(value),
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
// ignore_for_file: overridden_fields
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
||||||
|
|
||||||
|
@ -23,6 +25,7 @@ class FlutterFormInputPlainText extends FlutterFormInputWidget<String> {
|
||||||
this.scrollPadding,
|
this.scrollPadding,
|
||||||
this.maxLength,
|
this.maxLength,
|
||||||
this.keyboardType,
|
this.keyboardType,
|
||||||
|
this.enabled = true,
|
||||||
}) : super(
|
}) : super(
|
||||||
key: key,
|
key: key,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
|
@ -36,6 +39,8 @@ class FlutterFormInputPlainText extends FlutterFormInputWidget<String> {
|
||||||
final int? maxLength;
|
final int? maxLength;
|
||||||
final EdgeInsets? scrollPadding;
|
final EdgeInsets? scrollPadding;
|
||||||
final TextInputType? keyboardType;
|
final TextInputType? keyboardType;
|
||||||
|
@override
|
||||||
|
final bool enabled;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -49,6 +54,7 @@ class FlutterFormInputPlainText extends FlutterFormInputWidget<String> {
|
||||||
);
|
);
|
||||||
|
|
||||||
return input.FlutterFormInputPlainText(
|
return input.FlutterFormInputPlainText(
|
||||||
|
enabled: enabled,
|
||||||
scrollPadding: scrollPadding ?? const EdgeInsets.all(20.0),
|
scrollPadding: scrollPadding ?? const EdgeInsets.all(20.0),
|
||||||
initialValue: controller.value,
|
initialValue: controller.value,
|
||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
|
@ -81,6 +87,7 @@ class FlutterFormInputMultiLine extends StatelessWidget {
|
||||||
this.label,
|
this.label,
|
||||||
this.hint,
|
this.hint,
|
||||||
this.maxCharacters,
|
this.maxCharacters,
|
||||||
|
this.enabled = true,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final FlutterFormInputController<String> controller;
|
final FlutterFormInputController<String> controller;
|
||||||
|
@ -89,12 +96,14 @@ class FlutterFormInputMultiLine extends StatelessWidget {
|
||||||
|
|
||||||
final String? hint;
|
final String? hint;
|
||||||
final int? maxCharacters;
|
final int? maxCharacters;
|
||||||
|
final bool enabled;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||||
|
|
||||||
return input.FlutterFormInputMultiLine(
|
return input.FlutterFormInputMultiLine(
|
||||||
|
enabled: enabled,
|
||||||
label: label,
|
label: label,
|
||||||
hint: hint,
|
hint: hint,
|
||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: flutter_form_wizard
|
name: flutter_form_wizard
|
||||||
description: A new Flutter package project.
|
description: A new Flutter package project.
|
||||||
version: 6.1.5
|
version: 6.1.6
|
||||||
homepage: https://github.com/Iconica-Development/flutter_form_wizard
|
homepage: https://github.com/Iconica-Development/flutter_form_wizard
|
||||||
|
|
||||||
publish_to: none
|
publish_to: none
|
||||||
|
|
Loading…
Reference in a new issue