mirror of
https://github.com/Iconica-Development/flutter_form_wizard.git
synced 2025-05-19 10:53:49 +02:00
Merge pull request #25 from Iconica-Development/feature/remove_riverpod
Bump `flutter_input_library` to version 2.0.0, remove unnecessary `ri…
This commit is contained in:
commit
6cca640496
16 changed files with 41 additions and 83 deletions
|
@ -70,4 +70,9 @@
|
|||
|
||||
## 5.0.9 - January 18th 2023
|
||||
|
||||
- `flutter_input_library` add initial time picker parameter
|
||||
- `flutter_input_library` add initial time picker parameter
|
||||
|
||||
## 6.0.0 - march 28th 2023
|
||||
|
||||
- Bump `flutter_input_library` to version 2.0.0
|
||||
- Remove unnecessary `riverpod` dependency
|
|
@ -3,7 +3,7 @@
|
|||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
|
@ -171,6 +171,7 @@
|
|||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
|
@ -185,6 +186,7 @@
|
|||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
|
|
|
@ -68,16 +68,16 @@ packages:
|
|||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "5.0.9"
|
||||
version: "6.0.0"
|
||||
flutter_input_library:
|
||||
dependency: transitive
|
||||
description:
|
||||
path: "."
|
||||
ref: "1.0.6"
|
||||
resolved-ref: c55174c2a35071677b6dd5bfba1afe5c466103aa
|
||||
ref: "2.0.0"
|
||||
resolved-ref: "7b3a6dba90b85c108983fa8b94fa2e79aeb67316"
|
||||
url: "https://github.com/Iconica-Development/flutter_input_library"
|
||||
source: git
|
||||
version: "1.0.6"
|
||||
version: "2.0.0"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
|
@ -128,14 +128,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
localization:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: localization
|
||||
sha256: "01d892155364dc456e1141dd8003e43c98d457f2b51fe1b8984766bad2a3fd72"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_wizard/utils/translation_service.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../flutter_form.dart';
|
||||
import 'utils/form_page_controller.dart';
|
||||
import 'utils/formstate.dart' as fs;
|
||||
|
@ -180,7 +178,7 @@ import 'utils/formstate.dart' as fs;
|
|||
/// ),
|
||||
/// ),
|
||||
/// ```
|
||||
class FlutterForm extends ConsumerStatefulWidget {
|
||||
class FlutterForm extends StatefulWidget {
|
||||
const FlutterForm({
|
||||
Key? key,
|
||||
required this.options,
|
||||
|
@ -191,10 +189,10 @@ class FlutterForm extends ConsumerStatefulWidget {
|
|||
final FlutterFormController formController;
|
||||
|
||||
@override
|
||||
ConsumerState<FlutterForm> createState() => _FlutterFormState();
|
||||
State<FlutterForm> createState() => _FlutterFormState();
|
||||
}
|
||||
|
||||
class _FlutterFormState extends ConsumerState<FlutterForm> {
|
||||
class _FlutterFormState extends State<FlutterForm> {
|
||||
late FlutterFormController _formController;
|
||||
|
||||
@override
|
||||
|
@ -228,7 +226,7 @@ class _FlutterFormState extends ConsumerState<FlutterForm> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var _ = getTranslator(context, ref);
|
||||
var _ = getTranslator(context);
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '/src/utils/formstate.dart' as fs;
|
||||
|
||||
/// Abstract class for the input widgets used in a [FlutterForm].
|
||||
|
@ -14,7 +13,7 @@ import '/src/utils/formstate.dart' as fs;
|
|||
/// label is a standard parameter to normally sets the label of the input.
|
||||
///
|
||||
/// [registerController] should be called to register the given [controller] to the form page.
|
||||
abstract class FlutterFormInputWidget<T> extends ConsumerWidget {
|
||||
abstract class FlutterFormInputWidget<T> extends StatelessWidget {
|
||||
const FlutterFormInputWidget({
|
||||
Key? key,
|
||||
required this.controller,
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_wizard/utils/translation_service.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_form_wizard/flutter_form.dart';
|
||||
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
||||
|
||||
|
@ -28,9 +26,8 @@ class FlutterFormInputCarousel extends FlutterFormInputWidget<int> {
|
|||
final double height;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
String Function(String, {List<String>? params}) _ =
|
||||
getTranslator(context, ref);
|
||||
Widget build(BuildContext context) {
|
||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||
|
||||
super.registerController(context);
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
||||
import 'package:flutter_form_wizard/utils/translation_service.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../../../../../flutter_form.dart';
|
||||
|
@ -41,9 +39,8 @@ class FlutterFormInputDateTime extends FlutterFormInputWidget<String> {
|
|||
final IconData icon;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
String Function(String, {List<String>? params}) _ =
|
||||
getTranslator(context, ref);
|
||||
Widget build(BuildContext context) {
|
||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||
super.registerController(context);
|
||||
|
||||
return input.FlutterFormInputDateTime(
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_wizard/utils/translation_service.dart';
|
||||
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../../../../flutter_form.dart';
|
||||
|
||||
|
@ -26,9 +24,8 @@ class FlutterFormInputEmail extends FlutterFormInputWidget<String> {
|
|||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
String Function(String, {List<String>? params}) _ =
|
||||
getTranslator(context, ref);
|
||||
Widget build(BuildContext context) {
|
||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||
|
||||
super.registerController(context);
|
||||
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_wizard/utils/translation_service.dart';
|
||||
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../../../../flutter_form.dart';
|
||||
|
||||
/// Input for a number used in a [FlutterForm].
|
||||
|
@ -29,9 +27,8 @@ class FlutterFormInputNumberPicker extends FlutterFormInputWidget<int> {
|
|||
final int maxValue;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
String Function(String, {List<String>? params}) _ =
|
||||
getTranslator(context, ref);
|
||||
Widget build(BuildContext context) {
|
||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||
|
||||
super.registerController(context);
|
||||
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_wizard/utils/translation_service.dart';
|
||||
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../../../../flutter_form.dart';
|
||||
|
||||
/// Input for a password used in a [FlutterForm].
|
||||
|
@ -24,11 +22,10 @@ class FlutterFormInputPassword extends FlutterFormInputWidget<String> {
|
|||
label: label);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
Widget build(BuildContext context) {
|
||||
super.registerController(context);
|
||||
|
||||
String Function(String, {List<String>? params}) _ =
|
||||
getTranslator(context, ref);
|
||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||
|
||||
return input.FlutterFormInputPassword(
|
||||
initialValue: controller.value,
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../../../../flutter_form.dart';
|
||||
|
||||
|
@ -39,9 +38,8 @@ class FlutterFormInputPlainText extends FlutterFormInputWidget<String> {
|
|||
final TextInputType? keyboardType;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
String Function(String, {List<String>? params}) _ =
|
||||
getTranslator(context, ref);
|
||||
Widget build(BuildContext context) {
|
||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||
|
||||
super.registerController(context);
|
||||
|
||||
|
@ -75,7 +73,7 @@ class FlutterFormInputPlainText extends FlutterFormInputWidget<String> {
|
|||
/// Hint can be set to set a hint inside the field.
|
||||
///
|
||||
/// MaxCharacters can be set to set a maximum amount of characters.
|
||||
class FlutterFormInputMultiLine extends ConsumerWidget {
|
||||
class FlutterFormInputMultiLine extends StatelessWidget {
|
||||
const FlutterFormInputMultiLine({
|
||||
Key? key,
|
||||
required this.controller,
|
||||
|
@ -93,9 +91,8 @@ class FlutterFormInputMultiLine extends ConsumerWidget {
|
|||
final int? maxCharacters;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
String Function(String, {List<String>? params}) _ =
|
||||
getTranslator(context, ref);
|
||||
Widget build(BuildContext context) {
|
||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||
|
||||
return input.FlutterFormInputMultiLine(
|
||||
label: label,
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
||||
import 'package:flutter_form_wizard/utils/translation_service.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../../../../../flutter_form.dart';
|
||||
|
||||
|
@ -31,9 +29,8 @@ class FlutterFormInputSlider extends FlutterFormInputWidget<double> {
|
|||
final int maxValue;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
String Function(String, {List<String>? params}) _ =
|
||||
getTranslator(context, ref);
|
||||
Widget build(BuildContext context) {
|
||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||
|
||||
super.registerController(context);
|
||||
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_wizard/flutter_form.dart';
|
||||
import 'package:flutter_input_library/flutter_input_library.dart' as input;
|
||||
import 'package:flutter_form_wizard/utils/translation_service.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
/// Input for a boolean switch. Used in a [FlutterForm].
|
||||
///
|
||||
|
@ -24,9 +22,8 @@ class FlutterFormInputSwitch extends FlutterFormInputWidget<bool> {
|
|||
label: label);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
String Function(String, {List<String>? params}) _ =
|
||||
getTranslator(context, ref);
|
||||
Widget build(BuildContext context) {
|
||||
String Function(String, {List<String>? params}) _ = getTranslator(context);
|
||||
|
||||
super.registerController(context);
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter_form_wizard/utils/translation_service.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
/// Provides the [ShellTranslationService]
|
||||
final translationServiceProvider =
|
||||
Provider<TranslationService>((ref) => ShellTranslationService());
|
|
@ -3,8 +3,6 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_wizard/utils/providers.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
abstract class TranslationService {
|
||||
TranslationService._();
|
||||
|
@ -35,9 +33,9 @@ class ShellTranslationService implements TranslationService {
|
|||
}
|
||||
}
|
||||
|
||||
Translator getTranslator(BuildContext context, WidgetRef ref) {
|
||||
Translator getTranslator(BuildContext context) {
|
||||
try {
|
||||
var translator = ref.read(translationServiceProvider).translate;
|
||||
var translator = ShellTranslationService().translate;
|
||||
return (
|
||||
String key, {
|
||||
List<String>? params,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: flutter_form_wizard
|
||||
description: A new Flutter package project.
|
||||
version: 5.0.9
|
||||
version: 6.0.0
|
||||
homepage: https://github.com/Iconica-Development/flutter_form_wizard
|
||||
|
||||
publish_to: none
|
||||
|
@ -14,13 +14,11 @@ dependencies:
|
|||
sdk: flutter
|
||||
flutter_localizations:
|
||||
sdk: flutter
|
||||
flutter_riverpod: ^2.1.1
|
||||
intl: ^0.17.0
|
||||
localization: ^2.1.0
|
||||
flutter_input_library:
|
||||
git:
|
||||
url: https://github.com/Iconica-Development/flutter_input_library
|
||||
ref: 1.0.6
|
||||
ref: 2.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
Loading…
Reference in a new issue