diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json deleted file mode 100644 index 792b69f..0000000 --- a/.fvm/fvm_config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "flutterSdkVersion": "3.16.5" -} \ No newline at end of file diff --git a/.fvmrc b/.fvmrc index 22e8233..0fdcb48 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,3 @@ { - "flutter": "3.16.5" + "flutter": "3.27.1" } \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e47f8d8..bdcbc0a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,26 +21,24 @@ jobs: channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} - name: Install DCM - uses: CQLabs/setup-dcm@v1 + uses: CQLabs/setup-dcm@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - version: 1.24.2 + github-token: ${{ secrets.GITHUB_TOKEN }} + version: 1.26.2 - - uses: bluefireteam/melos-action@v2 + - uses: bluefireteam/melos-action@v3 - name: Dart Analyze run: melos run lint:dart - name: Run DCM - uses: CQLabs/dcm-action@v1 + uses: CQLabs/dcm-action@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - ci_key: ${{ secrets.DCM_KEY }} + github-token: ${{ secrets.GITHUB_TOKEN }} + ci-key: ${{ secrets.DCM_KEY }} email: ${{ secrets.DCM_EMAIL }} folders: . - fatal_style: true - fatal_performance: true - fatal_warnings: true + fatal-found: true - name: Test run: melos run test diff --git a/.github/workflows/storybook.yaml b/.github/workflows/storybook.yaml index e4cd04b..1bfeba2 100644 --- a/.github/workflows/storybook.yaml +++ b/.github/workflows/storybook.yaml @@ -46,7 +46,7 @@ jobs: flutter-version: ${{ env.FLUTTER_VERSION }} channel: ${{ env.FLUTTER_CHANNEL }} - - uses: bluefireteam/melos-action@v2 + - uses: bluefireteam/melos-action@v3 - name: Setup run: | @@ -57,7 +57,7 @@ jobs: run: flutter build web --base-href "/glade_forms/" - name: Setup Pages - uses: actions/configure-pages@v3 + uses: actions/configure-pages@v5 - name: Upload artifact uses: actions/upload-pages-artifact@v2 diff --git a/.vscode/settings.json b/.vscode/settings.json index 0b9fca7..0b1a941 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "dart.flutterSdkPath": ".fvm/versions/3.16.5", + "dart.flutterSdkPath": ".fvm/versions/3.27.1", "dart.lineLength": 120, "yaml.schemaStore.enable": false } \ No newline at end of file diff --git a/dcm_global.yaml b/dcm_global.yaml index 8f4b791..b44467d 100644 --- a/dcm_global.yaml +++ b/dcm_global.yaml @@ -1 +1 @@ -version: "1.24.2" +version: "1.26.2" diff --git a/glade_forms/CHANGELOG.md b/glade_forms/CHANGELOG.md index ba8d55e..cf6ed06 100644 --- a/glade_forms/CHANGELOG.md +++ b/glade_forms/CHANGELOG.md @@ -1,3 +1,6 @@ +## 3.1.0 +- updated dependencies + # 3.0.1 - **[Fix]**: GladeFormProvider is missing key property [Fix 73](https://github.com/netglade/glade_forms/issues/73) - **[Fix]**: enable value transform with text editing controller [Fix 72](https://github.com/netglade/glade_forms/issues/72) diff --git a/glade_forms/analysis_options.yaml b/glade_forms/analysis_options.yaml index 14cbcba..b647e51 100644 --- a/glade_forms/analysis_options.yaml +++ b/glade_forms/analysis_options.yaml @@ -5,3 +5,17 @@ dart_code_metrics: - package:netglade_analysis/dcm.yaml pubspec-rules: prefer-publish-to-none: false + rules: + avoid-commented-out-code: false # code examples in comments + prefer-boolean-prefixes: false # # TODO: release new major version (breaking change) + prefer-named-parameters: false # TODO: release new major version (breaking change) + dispose-class-fields: false # callback parameters are better without named + avoid-undisposed-instances: + ignored-invocations: + - WithAutoDispose + prefer-single-declaration-per-file: + exclude: + - build/unit_test_assets/** + prefer-abstract-final-static-class: + exclude: + - build/unit_test_assets/** \ No newline at end of file diff --git a/glade_forms/example/lib/example.dart b/glade_forms/example/lib/example.dart index fed57a9..5b6d137 100644 --- a/glade_forms/example/lib/example.dart +++ b/glade_forms/example/lib/example.dart @@ -17,7 +17,10 @@ class _Model extends GladeModel { age = GladeInput.intInput(value: 0, inputKey: 'age'); email = GladeInput.stringInput(validator: (validator) => (validator..isEmail()).build(), inputKey: 'email'); income = GladeInput.intInput( - value: 10000, validator: (validator) => (validator..isMin(min: 1000)).build(), inputKey: 'income'); + value: 10000, + validator: (validator) => (validator..isMin(min: 1000)).build(), + inputKey: 'income', + ); super.initialize(); } @@ -29,6 +32,7 @@ class Example extends StatelessWidget { @override Widget build(BuildContext context) { return GladeFormBuilder.create( + // ignore: avoid-undisposed-instances, handled by GladeFormBuilder create: (context) => _Model(), builder: (context, model, _) => Padding( padding: const EdgeInsets.all(32), @@ -58,6 +62,7 @@ class Example extends StatelessWidget { ), const SizedBox(height: 10), ElevatedButton( + // ignore: no-empty-block, empty function, just for example onPressed: model.isValid ? () {} : null, child: const Text('Save'), ), diff --git a/glade_forms/example/pubspec.yaml b/glade_forms/example/pubspec.yaml index 3230165..bdfdad1 100644 --- a/glade_forms/example/pubspec.yaml +++ b/glade_forms/example/pubspec.yaml @@ -4,7 +4,10 @@ version: 1.0.1 publish_to: none environment: - sdk: ">=2.18.7 <4.0.0" + sdk: ">=3.5.0 <4.0.0" +resolution: workspace dependencies: - glade_forms: ^1.1.0 + flutter: + sdk: flutter + glade_forms: ^3.1.0 diff --git a/glade_forms/lib/src/core/glade_error_keys.dart b/glade_forms/lib/src/core/glade_error_keys.dart index eab487f..7c86cd8 100644 --- a/glade_forms/lib/src/core/glade_error_keys.dart +++ b/glade_forms/lib/src/core/glade_error_keys.dart @@ -1,4 +1,4 @@ -class GladeErrorKeys { +abstract final class GladeErrorKeys { static const String conversionError = 'value-cant-be-converted'; static const String stringEmpty = 'string-empty-error'; static const String stringNotUrl = 'string-not-url'; diff --git a/glade_forms/lib/src/core/input_dependencies.dart b/glade_forms/lib/src/core/input_dependencies.dart index 888eea8..e4ebf12 100644 --- a/glade_forms/lib/src/core/input_dependencies.dart +++ b/glade_forms/lib/src/core/input_dependencies.dart @@ -2,6 +2,7 @@ import 'package:collection/collection.dart'; import 'package:glade_forms/src/core/core.dart'; +import 'package:glade_forms/src/core/object_ex.dart'; typedef InputDependencies = List>; typedef InputDependenciesFactory = InputDependencies Function(); @@ -13,8 +14,3 @@ extension InputDependenciesFunctions on InputDependencies { /// Finds input by its key or returns null. GladeInput? byKeyOrNull(String key) => firstWhereOrNull((x) => x.inputKey == key).castOrNull(); } - -extension ObjectEx on Object? { - T? castOrNull() => this is T ? this as T : null; - T cast() => this as T; -} diff --git a/glade_forms/lib/src/core/object_ex.dart b/glade_forms/lib/src/core/object_ex.dart new file mode 100644 index 0000000..f69cd74 --- /dev/null +++ b/glade_forms/lib/src/core/object_ex.dart @@ -0,0 +1,5 @@ +extension ObjectEx on Object? { + T? castOrNull() => this is T ? this as T : null; + + T cast() => this as T; +} diff --git a/glade_forms/lib/src/core/type_helper.dart b/glade_forms/lib/src/core/type_helper.dart index 7647771..222176e 100644 --- a/glade_forms/lib/src/core/type_helper.dart +++ b/glade_forms/lib/src/core/type_helper.dart @@ -1,4 +1,4 @@ -class TypeHelper { +abstract final class TypeHelper { static bool typesEqual() => T1 == T2; static bool typeIsNullable() => null is T; diff --git a/glade_forms/lib/src/validator/int_validator.dart b/glade_forms/lib/src/validator/int_validator.dart index a430efd..7e610f4 100644 --- a/glade_forms/lib/src/validator/int_validator.dart +++ b/glade_forms/lib/src/validator/int_validator.dart @@ -1,8 +1,6 @@ import 'package:glade_forms/src/src.dart'; class IntValidator extends GladeValidator { - IntValidator(); - /// Compares given value with [min] and [max] values. With [inclusiveInterval] set to true(default), the comparison is inclusive. void isBetween({ required int min, diff --git a/glade_forms/lib/src/validator/regex_patterns.dart b/glade_forms/lib/src/validator/regex_patterns.dart index 1384ba5..e27dd87 100644 --- a/glade_forms/lib/src/validator/regex_patterns.dart +++ b/glade_forms/lib/src/validator/regex_patterns.dart @@ -1,4 +1,4 @@ -class RegexPatterns { +abstract final class RegexPatterns { static const email = r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$'; static const urlWithOptionalHttp = r'^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&\(\)\*\+,;=.]+$'; static const urlWithHttp = diff --git a/glade_forms/lib/src/validator/string_validator.dart b/glade_forms/lib/src/validator/string_validator.dart index 63286a4..8e23624 100644 --- a/glade_forms/lib/src/validator/string_validator.dart +++ b/glade_forms/lib/src/validator/string_validator.dart @@ -2,8 +2,6 @@ import 'package:glade_forms/src/core/glade_error_keys.dart'; import 'package:glade_forms/src/validator/validator.dart'; class StringValidator extends GladeValidator { - StringValidator(); - /// Given value can't be empty string (or null). void notEmpty({ OnValidateError? devError, diff --git a/glade_forms/lib/src/widgets/glade_form_listener.dart b/glade_forms/lib/src/widgets/glade_form_listener.dart index eb4e310..84e6255 100644 --- a/glade_forms/lib/src/widgets/glade_form_listener.dart +++ b/glade_forms/lib/src/widgets/glade_form_listener.dart @@ -44,13 +44,13 @@ class _GladeFormListenerState extends State(); - widget.listener(context, m, m.lastUpdatedInputKeys); - } - @override Widget build(BuildContext context) { return widget.child; } + + void _onModelUpdate() { + final m = context.read(); + widget.listener(context, m, m.lastUpdatedInputKeys); + } } diff --git a/glade_forms/lib/src/widgets/glade_model_debug_info.dart b/glade_forms/lib/src/widgets/glade_model_debug_info.dart index 5ac4ba2..77a5624 100644 --- a/glade_forms/lib/src/widgets/glade_model_debug_info.dart +++ b/glade_forms/lib/src/widgets/glade_model_debug_info.dart @@ -1,4 +1,3 @@ -import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:glade_forms/src/model/glade_model.dart'; import 'package:glade_forms/src/widgets/glade_form_builder.dart'; @@ -196,7 +195,7 @@ class _Table extends StatelessWidget { return Table( defaultColumnWidth: scrollable ? const IntrinsicColumnWidth() : const FlexColumnWidth(), - border: TableBorder.symmetric(outside: const BorderSide()), + border: const TableBorder.symmetric(outside: BorderSide()), children: [ // Columns header. TableRow( @@ -212,8 +211,8 @@ class _Table extends StatelessWidget { if (showControllerText) const _ColumnHeader('controller.text'), ], ), - ...inputs.mapIndexed( - (index, x) => TableRow( + for (final (index, x) in inputs.indexed) + TableRow( decoration: BoxDecoration(color: index.isEven ? Colors.white : const Color.fromARGB(255, 235, 234, 234)), children: [ Padding( @@ -229,7 +228,6 @@ class _Table extends StatelessWidget { if (showControllerText) _RowValue(value: x.controller?.text, colorizedValue: true), ], ), - ), ], ); } @@ -365,6 +363,19 @@ class _DangerStrips extends StatelessWidget { required this.gap, }); + @override + Widget build(BuildContext context) { + return SizedBox( + height: 5, + width: double.infinity, + child: LayoutBuilder( + builder: (context, constraints) { + return Stack(children: _getListOfStripes((constraints.maxWidth / 2).ceil())); + }, + ), + ); + } + List _getListOfStripes(int count) { final stripes = []; for (var i = 0; i < count; i++) { @@ -378,17 +389,4 @@ class _DangerStrips extends StatelessWidget { return stripes; } - - @override - Widget build(BuildContext context) { - return SizedBox( - height: 5, - width: double.infinity, - child: LayoutBuilder( - builder: (context, constraints) { - return Stack(children: _getListOfStripes((constraints.maxWidth / 2).ceil())); - }, - ), - ); - } } diff --git a/glade_forms/lib/src/widgets/glade_model_debug_info_modal.dart b/glade_forms/lib/src/widgets/glade_model_debug_info_modal.dart index c525bdb..4ce8099 100644 --- a/glade_forms/lib/src/widgets/glade_model_debug_info_modal.dart +++ b/glade_forms/lib/src/widgets/glade_model_debug_info_modal.dart @@ -3,8 +3,9 @@ import 'package:glade_forms/src/model/glade_model.dart'; import 'package:glade_forms/src/widgets/glade_model_debug_info.dart'; import 'package:glade_forms/src/widgets/glade_model_provider.dart'; -class GladeModelDebugInfoModal { +abstract final class GladeModelDebugInfoModal { const GladeModelDebugInfoModal(); + static void showDebugInfoModel(BuildContext context, M model) { final _ = showModalBottomSheet( context: context, diff --git a/glade_forms/pubspec.yaml b/glade_forms/pubspec.yaml index 4888a93..07a37ba 100644 --- a/glade_forms/pubspec.yaml +++ b/glade_forms/pubspec.yaml @@ -1,6 +1,6 @@ name: glade_forms description: A universal way to define form validators with support of translations. -version: 3.0.1 +version: 3.1.0 repository: https://github.com/netglade/glade_forms issue_tracker: https://github.com/netglade/glade_forms/issues screenshots: @@ -8,7 +8,8 @@ screenshots: path: doc/icon.png environment: - sdk: ^3.0.0 + sdk: ^3.5.0 +resolution: workspace # Add regular dependencies here. dependencies: @@ -20,5 +21,5 @@ dependencies: provider: ^6.0.5 dev_dependencies: - netglade_analysis: ^7.0.0 - test: ^1.24.6 + netglade_analysis: ^15.0.0 + test: ^1.25.8 diff --git a/melos.yaml b/melos.yaml deleted file mode 100644 index 6358148..0000000 --- a/melos.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: glade_forms_workspace - -packages: - - glade_forms - - glade_forms/example - - storybook - -command: - bootstrap: - usePubspecOverrides: true - -scripts: - setup: - description: Completely setups project - run: | - melos exec -- fvm flutter pub get - melos run gallery_setup - - setup:win: - description: Completely setups project - run: | - melos exec -- fvm flutter pub get ^ - melos run gallery_setup:win - - # ANALYZING - - lint:all: - run: melos run lint:dart && melos run lint:dcm - description: Run all static analysis checks. - - lint:dart: - run: melos exec -- dart analyze . --fatal-infos - description: Run Dart static analysis checks. - - lint:dcm: - run: melos exec -- dcm analyze . --fatal-style --fatal-performance --fatal-warnings - description: Run DCM static analysis checks. - - # TESTING - - test: - run: melos exec -- flutter test - packageFilters: - dirExists: test - description: Run all Dart tests. - - # Gallery - gallery_setup: - run: | - melos exec -- flutter pub run easy_localization:generate -S "assets/translations" -o locale_loader.g.dart - melos exec -- fvm flutter pub run easy_localization:generate -S "assets/translations" --skip-unnecessary-keys -f keys -o locale_keys.g.dart - packageFilters: - dependsOn: easy_localization - - gallery_setup:win: - run: | - melos exec -- flutter pub run easy_localization:generate -S "assets/translations" -o locale_loader.g.dart ^ - melos exec -- fvm flutter pub run easy_localization:generate -S "assets/translations" --skip-unnecessary-keys -f keys -o locale_keys.g.dart - packageFilters: - dependsOn: easy_localization diff --git a/pubspec.yaml b/pubspec.yaml index c2e08a8..c64c9cc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,64 @@ name: glade_forms_workspace publish_to: "none" environment: - sdk: ">=2.18.0 <4.0.0" + sdk: ">=3.6.0 <4.0.0" + +workspace: + - glade_forms + - glade_forms/example + - storybook dev_dependencies: - melos: ^3.0.0 + melos: ^7.0.0-dev.3 + easy_localization: ^3.0.7 + +melos: + scripts: + setup: + description: Completely setups project + run: | + melos exec -- fvm flutter pub get + melos run gallery_setup + + setup:win: + description: Completely setups project + run: | + melos exec -- fvm flutter pub get ^ + melos run gallery_setup:win + + # ANALYZING + + lint:all: + run: melos run lint:dart && melos run lint:dcm + description: Run all static analysis checks. + + lint:dart: + run: melos exec -- dart analyze . --fatal-infos + description: Run Dart static analysis checks. + + lint:dcm: + run: melos exec -- dcm analyze . --fatal-style --fatal-performance --fatal-warnings + description: Run DCM static analysis checks. + + # TESTING + + test: + run: melos exec -- flutter test + packageFilters: + dirExists: test + description: Run all Dart tests. + + # Gallery + gallery_setup: + run: | + melos exec -- flutter pub run easy_localization:generate -S "assets/translations" -o locale_loader.g.dart + melos exec -- fvm flutter pub run easy_localization:generate -S "assets/translations" --skip-unnecessary-keys -f keys -o locale_keys.g.dart + packageFilters: + dependsOn: easy_localization + + gallery_setup:win: + run: | + melos exec -- flutter pub run easy_localization:generate -S "assets/translations" -o locale_loader.g.dart ^ + melos exec -- fvm flutter pub run easy_localization:generate -S "assets/translations" --skip-unnecessary-keys -f keys -o locale_keys.g.dart + packageFilters: + dependsOn: easy_localization diff --git a/storybook/analysis_options.yaml b/storybook/analysis_options.yaml index 11650bc..9d15bb8 100644 --- a/storybook/analysis_options.yaml +++ b/storybook/analysis_options.yaml @@ -9,3 +9,8 @@ analyzer: dart_code_metrics: extends: - package:netglade_analysis/dcm.yaml + rules: + prefer-single-declaration-per-file: false + avoid-commented-out-code: false # code examples in comments + prefer-boolean-prefixes: false # TODO + prefer-abstract-final-static-class: false # TODO diff --git a/storybook/lib/generated/locale_loader.g.dart b/storybook/lib/generated/locale_loader.g.dart index fa8ec45..7f8bb92 100644 --- a/storybook/lib/generated/locale_loader.g.dart +++ b/storybook/lib/generated/locale_loader.g.dart @@ -1,6 +1,6 @@ // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart -// ignore_for_file: prefer_single_quotes +// ignore_for_file: prefer_single_quotes, avoid_renaming_method_parameters import 'dart:ui'; diff --git a/storybook/lib/main.dart b/storybook/lib/main.dart index 6b8431a..1c018ab 100644 --- a/storybook/lib/main.dart +++ b/storybook/lib/main.dart @@ -22,7 +22,7 @@ void main() async { const debugModel = String.fromEnvironment('DEBUG_MODEL', defaultValue: 'false') == 'true'; if (debugModel) { - return runApp(const _DebugModelApp()); + runApp(const _DebugModelApp()); } runApp( diff --git a/storybook/lib/shared/usecase_container.dart b/storybook/lib/shared/usecase_container.dart index 0472d1f..5562235 100644 --- a/storybook/lib/shared/usecase_container.dart +++ b/storybook/lib/shared/usecase_container.dart @@ -5,7 +5,7 @@ import 'package:flutter_highlighter/themes/github.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; -class UsecaseContainer extends HookWidget { +class UsecaseContainer extends StatelessWidget { final Widget child; final String shortDescription; final String? description; @@ -52,10 +52,6 @@ class _CodeSample extends HookWidget { final String fileName; const _CodeSample({required this.fileName}); - Future _getFileContent() { - return rootBundle.loadString('lib/usecases/$fileName'); - } - @override Widget build(BuildContext context) { final getFileContentFutureMemo = useMemoized(_getFileContent); @@ -86,8 +82,10 @@ class _CodeSample extends HookWidget { ), ), ), - Align( + Container( alignment: Alignment.topRight, + padding: const EdgeInsets.all(8), + child: Padding( padding: const EdgeInsets.all(8), child: SizedBox( @@ -112,4 +110,8 @@ class _CodeSample extends HookWidget { }, ); } + + Future _getFileContent() { + return rootBundle.loadString('lib/usecases/$fileName'); + } } diff --git a/storybook/lib/usecases/complex_object_mapping_example.dart b/storybook/lib/usecases/complex_object_mapping_example.dart index 32c88de..212afbb 100644 --- a/storybook/lib/usecases/complex_object_mapping_example.dart +++ b/storybook/lib/usecases/complex_object_mapping_example.dart @@ -86,9 +86,9 @@ class ComplexObjectMappingExample extends StatelessWidget { validator: model.availableStats.textFormFieldInputValidator, ), Row( + spacing: 30, children: [ const Text('Character item'), - const SizedBox(width: 30), DropdownButton( items: model.availableItems .map( diff --git a/storybook/lib/usecases/dependencies/checkbox_dependency_change.dart b/storybook/lib/usecases/dependencies/checkbox_dependency_change.dart index 37ea0c2..ad24e5e 100644 --- a/storybook/lib/usecases/dependencies/checkbox_dependency_change.dart +++ b/storybook/lib/usecases/dependencies/checkbox_dependency_change.dart @@ -1,4 +1,4 @@ -// ignore_for_file: prefer-match-file-name, avoid-passing-self-as-argument +// ignore_for_file: prefer-match-file-name, avoid-passing-self-as-argument, prefer-single-widget-per-file import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; @@ -6,7 +6,7 @@ import 'package:glade_forms/glade_forms.dart'; import 'package:glade_forms_storybook/generated/locale_keys.g.dart'; import 'package:glade_forms_storybook/shared/usecase_container.dart'; -class _ErrorKeys { +abstract final class _ErrorKeys { static const String ageRestriction = 'age-restriction'; } diff --git a/storybook/lib/usecases/onchange/one_checkbox_deps_validation.dart b/storybook/lib/usecases/onchange/one_checkbox_deps_validation.dart index 5f0a762..1e20d31 100644 --- a/storybook/lib/usecases/onchange/one_checkbox_deps_validation.dart +++ b/storybook/lib/usecases/onchange/one_checkbox_deps_validation.dart @@ -1,4 +1,4 @@ -// ignore_for_file: prefer-match-file-name, avoid-passing-self-as-argument +// ignore_for_file: prefer-match-file-name, avoid-passing-self-as-argument, prefer-single-widget-per-file import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; @@ -6,7 +6,7 @@ import 'package:glade_forms/glade_forms.dart'; import 'package:glade_forms_storybook/generated/locale_keys.g.dart'; import 'package:glade_forms_storybook/shared/usecase_container.dart'; -class _ErrorKeys { +abstract final class _ErrorKeys { static const String ageRestriction = 'age-restriction'; } diff --git a/storybook/lib/usecases/onchange/two_way_checkbox_change.dart b/storybook/lib/usecases/onchange/two_way_checkbox_change.dart index a83a901..eaa8593 100644 --- a/storybook/lib/usecases/onchange/two_way_checkbox_change.dart +++ b/storybook/lib/usecases/onchange/two_way_checkbox_change.dart @@ -1,4 +1,4 @@ -// ignore_for_file: prefer-match-file-name, avoid-passing-self-as-argument +// ignore_for_file: prefer-match-file-name, avoid-passing-self-as-argument, prefer-single-widget-per-file import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; @@ -6,7 +6,7 @@ import 'package:glade_forms/glade_forms.dart'; import 'package:glade_forms_storybook/generated/locale_keys.g.dart'; import 'package:glade_forms_storybook/shared/usecase_container.dart'; -class _ErrorKeys { +abstract final class _ErrorKeys { static const String ageRestriction = 'age-restriction'; } diff --git a/storybook/lib/usecases/quickstart_example.dart b/storybook/lib/usecases/quickstart_example.dart index 7a0e3aa..f022faa 100644 --- a/storybook/lib/usecases/quickstart_example.dart +++ b/storybook/lib/usecases/quickstart_example.dart @@ -11,8 +11,6 @@ class _Model extends GladeModel { @override List> get inputs => [name, age, email, income]; - _Model(); - @override void initialize() { name = GladeInput.stringInput(inputKey: 'name'); diff --git a/storybook/lib/usecases/regress/issue48_text_controller_example.dart b/storybook/lib/usecases/regress/issue48_text_controller_example.dart index c71ea84..6da7c1d 100644 --- a/storybook/lib/usecases/regress/issue48_text_controller_example.dart +++ b/storybook/lib/usecases/regress/issue48_text_controller_example.dart @@ -14,8 +14,6 @@ class _Model extends GladeModel { @override List> get inputs => [nameWithController, age, email, nameWrong]; - _Model(); - @override void initialize() { nameWithController = GladeInput.stringInput(inputKey: 'name'); @@ -27,7 +25,7 @@ class _Model extends GladeModel { } } -class Issue48TextControllerExample extends HookWidget { +class Issue48TextControllerExample extends StatelessWidget { const Issue48TextControllerExample({super.key}); @override diff --git a/storybook/pubspec.yaml b/storybook/pubspec.yaml index 0f6f025..4e1418c 100644 --- a/storybook/pubspec.yaml +++ b/storybook/pubspec.yaml @@ -4,15 +4,16 @@ version: 1.0.0 publish_to: none environment: - sdk: ^3.0.0 + sdk: ^3.5.0 +resolution: workspace dependencies: - easy_localization: ^3.0.3 + easy_localization: ^3.0.7 flutter: sdk: flutter flutter_highlighter: ^0.1.1 flutter_hooks: ^0.20.1 - flutter_markdown: ^0.6.17+3 + flutter_markdown: ^0.7.1 glade_forms: path: ../glade_forms provider: ^6.0.2 @@ -21,7 +22,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - netglade_analysis: ^7.0.0 + netglade_analysis: ^15.0.0 flutter: uses-material-design: true