Merge pull request #33 from Iconica-Development/fix/enabled-property

fix: add enabled property to FlutterFormInputPlainText and FlutterFor…
This commit is contained in:
Freek van de Ven 2023-10-27 11:40:15 +02:00 committed by GitHub
commit b1b442f2e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 7 deletions

View file

@ -95,4 +95,7 @@
- Bump `flutter_input_library` to version 2.3.0
## 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

View file

@ -68,7 +68,7 @@ packages:
path: ".."
relative: true
source: path
version: "6.1.4"
version: "6.1.5"
flutter_input_library:
dependency: transitive
description:

View file

@ -19,6 +19,7 @@ abstract class FlutterFormInputWidget<T> extends StatelessWidget {
required this.controller,
this.focusNode,
this.label,
this.enabled = true,
String? hintText,
}) : super(key: key);
@ -30,6 +31,8 @@ abstract class FlutterFormInputWidget<T> extends StatelessWidget {
final FocusNode? focusNode;
final bool enabled;
/// [registerController] should be called to register the given [controller] to the form page.
registerController(BuildContext context) {
FlutterFormInputController? localController =

View file

@ -2,6 +2,8 @@
//
// SPDX-License-Identifier: BSD-3-Clause
// ignore_for_file: overridden_fields, annotate_overrides
import 'package:flutter/material.dart';
import 'package:flutter_input_library/flutter_input_library.dart' as input;
import 'package:intl/intl.dart';
@ -24,6 +26,8 @@ class FlutterFormInputDateTime extends FlutterFormInputWidget<String> {
this.initialDate,
this.initialDateTimeRange,
this.icon = Icons.calendar_today,
this.enabled = true,
this.onTapEnabled = true,
}) : super(
key: key,
controller: controller,
@ -37,6 +41,8 @@ class FlutterFormInputDateTime extends FlutterFormInputWidget<String> {
final DateTime? firstDate;
final DateTime? lastDate;
final IconData icon;
final bool enabled;
final bool onTapEnabled;
@override
Widget build(BuildContext context) {
@ -44,6 +50,8 @@ class FlutterFormInputDateTime extends FlutterFormInputWidget<String> {
super.registerController(context);
return input.FlutterFormInputDateTime(
enabled: enabled,
onTapEnabled: onTapEnabled,
label: label,
icon: icon,
firstDate: firstDate,

View file

@ -16,11 +16,13 @@ class FlutterFormInputEmail extends FlutterFormInputWidget<String> {
required FlutterFormInputController<String> controller,
FocusNode? focusNode,
Widget? label,
bool? enabled,
}) : super(
key: key,
controller: controller,
focusNode: focusNode,
label: label,
enabled: enabled ?? true,
);
@override
@ -30,6 +32,7 @@ class FlutterFormInputEmail extends FlutterFormInputWidget<String> {
super.registerController(context);
return input.FlutterFormInputPlainText(
enabled: enabled,
initialValue: controller.value,
onSaved: (value) {
controller.onSaved(value);

View file

@ -15,11 +15,14 @@ class FlutterFormInputPassword extends FlutterFormInputWidget<String> {
required FlutterFormInputController<String> controller,
FocusNode? focusNode,
Widget? label,
bool? enabled,
}) : super(
key: key,
controller: controller,
focusNode: focusNode,
label: label);
key: key,
controller: controller,
focusNode: focusNode,
label: label,
enabled: enabled ?? true,
);
@override
Widget build(BuildContext context) {
@ -28,6 +31,7 @@ class FlutterFormInputPassword extends FlutterFormInputWidget<String> {
String Function(String, {List<String>? params}) _ = getTranslator(context);
return input.FlutterFormInputPassword(
enabled: enabled,
initialValue: controller.value,
focusNode: focusNode,
onSaved: (value) => controller.onSaved(value),

View file

@ -2,6 +2,8 @@
//
// SPDX-License-Identifier: BSD-3-Clause
// ignore_for_file: overridden_fields
import 'package:flutter/material.dart';
import 'package:flutter_input_library/flutter_input_library.dart' as input;
@ -23,6 +25,7 @@ class FlutterFormInputPlainText extends FlutterFormInputWidget<String> {
this.scrollPadding,
this.maxLength,
this.keyboardType,
this.enabled = true,
}) : super(
key: key,
controller: controller,
@ -36,6 +39,8 @@ class FlutterFormInputPlainText extends FlutterFormInputWidget<String> {
final int? maxLength;
final EdgeInsets? scrollPadding;
final TextInputType? keyboardType;
@override
final bool enabled;
@override
Widget build(BuildContext context) {
@ -49,6 +54,7 @@ class FlutterFormInputPlainText extends FlutterFormInputWidget<String> {
);
return input.FlutterFormInputPlainText(
enabled: enabled,
scrollPadding: scrollPadding ?? const EdgeInsets.all(20.0),
initialValue: controller.value,
focusNode: focusNode,
@ -81,6 +87,7 @@ class FlutterFormInputMultiLine extends StatelessWidget {
this.label,
this.hint,
this.maxCharacters,
this.enabled = true,
}) : super(key: key);
final FlutterFormInputController<String> controller;
@ -89,12 +96,14 @@ class FlutterFormInputMultiLine extends StatelessWidget {
final String? hint;
final int? maxCharacters;
final bool enabled;
@override
Widget build(BuildContext context) {
String Function(String, {List<String>? params}) _ = getTranslator(context);
return input.FlutterFormInputMultiLine(
enabled: enabled,
label: label,
hint: hint,
focusNode: focusNode,

View file

@ -1,6 +1,6 @@
name: flutter_form_wizard
description: A new Flutter package project.
version: 6.1.5
version: 6.1.6
homepage: https://github.com/Iconica-Development/flutter_form_wizard
publish_to: none