From 4531d6453ea20e54a4142e067487cb20a16fe15d Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Sun, 22 Dec 2024 09:53:59 +0100 Subject: [PATCH 1/5] build: update minimal flutter version --- example/pubspec.lock | 40 ++++++++++++++++++++-------------------- example/pubspec.yaml | 6 +++--- pubspec.yaml | 6 +++--- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index a933f8e..6678bfb 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" cupertino_icons: dependency: "direct main" description: @@ -66,10 +66,10 @@ packages: dependency: "direct main" description: name: flutter_form_builder - sha256: ba557c8933bef822fe5469f9267579379f362faf60c7a776c93bfa79cdda0446 + sha256: "39aee5a2548df0b3979a83eea38468116a888341fbca8a92c4be18a486a7bb57" url: "https://pub.dev" source: hosted - version: "9.4.0" + version: "9.6.0" flutter_lints: dependency: "direct dev" description: @@ -89,7 +89,7 @@ packages: path: ".." relative: true source: path - version: "0.3.0" + version: "0.4.0" intl: dependency: transitive description: @@ -102,18 +102,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -166,7 +166,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: @@ -179,10 +179,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" stream_channel: dependency: transitive description: @@ -195,10 +195,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -211,10 +211,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" vector_math: dependency: transitive description: @@ -227,10 +227,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.4" + version: "14.3.0" sdks: - dart: ">=3.5.0 <4.0.0" - flutter: ">=3.24.0" + dart: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index b01cfe3..b3eb773 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -5,14 +5,14 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.5.0 <4.0.0' - flutter: ">=3.24.0" + sdk: '>=3.6.0 <4.0.0' + flutter: ">=3.27.0" dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.8 - flutter_form_builder: ^9.4.0 + flutter_form_builder: ^9.6.0 form_builder_cupertino_fields: path: ../ diff --git a/pubspec.yaml b/pubspec.yaml index 70229d2..cd21d60 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,13 +12,13 @@ funding: - https://opencollective.com/flutter-form-builder-ecosystem environment: - sdk: '>=3.5.0 <4.0.0' - flutter: ">=3.24.0" + sdk: '>=3.6.0 <4.0.0' + flutter: ">=3.27.0" dependencies: flutter: sdk: flutter - flutter_form_builder: ^9.4.0 + flutter_form_builder: ^9.6.0 intl: ^0.19.0 dev_dependencies: From 52cf16ebd011e8896966735f475d3a79b9e4402f Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Sun, 22 Dec 2024 09:54:21 +0100 Subject: [PATCH 2/5] feat: add properties to checkbox and switch --- .../form_builder_cupertino_checkbox.dart | 53 +++- .../fields/form_builder_cupertino_switch.dart | 264 +++++++++++++++++- 2 files changed, 304 insertions(+), 13 deletions(-) diff --git a/lib/src/fields/form_builder_cupertino_checkbox.dart b/lib/src/fields/form_builder_cupertino_checkbox.dart index d47a14d..eab0ba4 100644 --- a/lib/src/fields/form_builder_cupertino_checkbox.dart +++ b/lib/src/fields/form_builder_cupertino_checkbox.dart @@ -45,10 +45,13 @@ class FormBuilderCupertinoCheckbox extends FormBuilderField { /// [prefix] and [child]. If null, the row is shorter. final Widget? Function(String error)? errorBuilder; - /// The color to use when this radio button is not selected. + /// {@macro flutter.cupertino.CupertinoCheckbox.fillColor} /// - /// Defaults to [CupertinoColors.white]. - final Color? inactiveColor; + /// If [fillColor] resolves to null for the requested state, then the fill color + /// falls back to [activeColor] if the state includes [WidgetState.selected], + /// [CupertinoColors.white] at 50% opacity if checkbox is disabled, + /// and [CupertinoColors.white] otherwise. + final WidgetStateProperty? fillColor; /// The color for the radio's border when it has the input focus. /// @@ -85,6 +88,40 @@ class FormBuilderCupertinoCheckbox extends FormBuilderField { /// [RoundedRectangleBorder] with a circular corner radius of 4.0. final OutlinedBorder? shape; + /// The semantic label for the checkbox that will be announced by screen readers. + /// + /// This is announced by assistive technologies (e.g TalkBack/VoiceOver). + /// + /// This label does not show in the UI. + final String? semanticLabel; + + /// {@macro flutter.widgets.Focus.autofocus} + final bool autofocus; + + /// The cursor for a mouse pointer when it enters or is hovering over the + /// widget. + /// + /// If [mouseCursor] is a [WidgetStateMouseCursor], + /// [WidgetStateProperty.resolve] is used for the following [WidgetState]s: + /// + /// * [WidgetState.selected]. + /// * [WidgetState.focused]. + /// * [WidgetState.disabled]. + /// + /// When [value] is null and [tristate] is true, [WidgetState.selected] is + /// included as a state. + /// + /// If null, then [SystemMouseCursors.basic] is used when this checkbox is + /// disabled. When the checkbox is enabled, [SystemMouseCursors.click] is used + /// on Web, and [SystemMouseCursors.basic] is used on other platforms. + /// + /// See also: + /// + /// * [WidgetStateMouseCursor], a [MouseCursor] that implements + /// [WidgetStateProperty] which is used in APIs that need to accept + /// either a [MouseCursor] or a [WidgetStateProperty]. + final MouseCursor? mouseCursor; + /// Creates On/Off Cupertino switch field FormBuilderCupertinoCheckbox({ super.key, @@ -106,11 +143,14 @@ class FormBuilderCupertinoCheckbox extends FormBuilderField { this.contentPadding, this.prefix, this.focusColor, - this.inactiveColor, + this.fillColor, this.checkColor, this.shape, this.side, this.tristate = false, + this.semanticLabel, + this.autofocus = false, + this.mouseCursor, }) : super( builder: (FormFieldState field) { final state = field as _FormBuilderCupertinoCheckboxState; @@ -118,12 +158,15 @@ class FormBuilderCupertinoCheckbox extends FormBuilderField { final fieldWidget = CupertinoCheckbox( focusColor: focusColor, focusNode: state.effectiveFocusNode, - inactiveColor: inactiveColor, + fillColor: fillColor, value: state.value ?? false, checkColor: checkColor, shape: shape, side: side, tristate: tristate, + autofocus: autofocus, + mouseCursor: mouseCursor, + semanticLabel: semanticLabel, onChanged: state.enabled ? (value) { field.didChange(value); diff --git a/lib/src/fields/form_builder_cupertino_switch.dart b/lib/src/fields/form_builder_cupertino_switch.dart index 65c8d3f..f5b0ecc 100644 --- a/lib/src/fields/form_builder_cupertino_switch.dart +++ b/lib/src/fields/form_builder_cupertino_switch.dart @@ -5,22 +5,238 @@ import 'package:flutter_form_builder/flutter_form_builder.dart'; /// On/Off Cupertino switch field class FormBuilderCupertinoSwitch extends FormBuilderField { - /// The color to use when this switch is on. + /// The color to use for the track when the switch is on. /// - /// Defaults to [CupertinoColors.systemGreen] when null and ignores - /// the [CupertinoTheme] in accordance to native iOS behavior. - final Color? activeColor; + /// If null and [applyTheme] is false, defaults to [CupertinoColors.systemGreen] + /// in accordance to native iOS behavior. Otherwise, defaults to + /// [CupertinoThemeData.primaryColor]. + /// + /// See also: + /// + /// * [inactiveTrackColor], the color to use for the track when the switch is off. + final Color? activeTrackColor; /// The color to use for the background when the switch is off. /// /// Defaults to [CupertinoColors.secondarySystemFill] when null. final Color? trackColor; - /// The color to use for the thumb of the switch. + /// The color to use on the thumb when the switch is off. + /// + /// If this color is not opaque, it is blended against + /// [CupertinoThemeData.scaffoldBackgroundColor], so as not to see through the + /// thumb to the track underneath. + /// + /// If null, defaults to [thumbColor]. If that is also null, + /// [CupertinoColors.white] is used. + /// + /// See also: + /// + /// * [thumbColor], the color to use for the thumb when the switch is on. + final Color? inactiveThumbColor; + + /// The color to use for the focus highlight for keyboard interactions. + /// + /// Defaults to [activeColor] with an opacity of 0.80, a brightness of 0.69 + /// and a saturation of 0.835. + final Color? focusColor; + + /// The color to use for the accessibility label when the switch is on. /// /// Defaults to [CupertinoColors.white] when null. + final Color? onLabelColor; + + /// The color to use for the accessibility label when the switch is off. + /// + /// Defaults to [Color.fromARGB(255, 179, 179, 179)] + /// (or [Color.fromARGB(255, 255, 255, 255)] in high contrast) when null. + final Color? offLabelColor; + + /// {@macro flutter.material.switch.activeThumbImage} + final ImageProvider? activeThumbImage; + + /// {@macro flutter.material.switch.onActiveThumbImageError} + final ImageErrorListener? onActiveThumbImageError; + + /// {@macro flutter.material.switch.inactiveThumbImage} + final ImageProvider? inactiveThumbImage; + + /// {@macro flutter.material.switch.onInactiveThumbImageError} + final ImageErrorListener? onInactiveThumbImageError; + + /// Handler called when the focus changes. + /// + /// Called with true if this widget's node gains focus, and false if it loses + /// focus. + final ValueChanged? onFocusChange; + + /// {@macro flutter.widgets.Focus.autofocus} + final bool autofocus; + + /// {@template flutter.cupertino.CupertinoSwitch.applyTheme} + /// Whether to apply the ambient [CupertinoThemeData]. + /// + /// If true, the track uses [CupertinoThemeData.primaryColor] for the track + /// when the switch is on. + /// + /// Defaults to [CupertinoThemeData.applyThemeToAll]. + /// {@endtemplate} + final bool? applyTheme; + + /// The color to use for the track when the switch is off. + /// + /// Defaults to [CupertinoColors.secondarySystemFill] when null. + /// + /// See also: + /// + /// * [activeTrackColor], the color to use for the track when the switch is on. + final Color? inactiveTrackColor; + + /// The color to use for the thumb when the switch is on. + /// + /// If this color is not opaque, it is blended against + /// [CupertinoThemeData.scaffoldBackgroundColor], so as not to see through the + /// thumb to the track underneath. + /// + /// Defaults to [CupertinoColors.white] when null. + /// + /// See also: + /// + /// * [inactiveThumbColor], the color to use for the thumb when the switch is off. final Color? thumbColor; + /// The cursor for a mouse pointer when it enters or is hovering over the + /// widget. + /// + /// Resolved in the following states: + /// * [WidgetState.selected]. + /// * [WidgetState.hovered]. + /// * [WidgetState.focused]. + /// * [WidgetState.disabled]. + /// + /// {@tool snippet} + /// This example resolves the [mouseCursor] based on the current + /// [WidgetState] of the [CupertinoSwitch], providing a different [mouseCursor] when it is + /// [WidgetState.disabled]. + /// + /// ```dart + /// CupertinoSwitch( + /// value: true, + /// onChanged: (bool value) { }, + /// mouseCursor: WidgetStateProperty.resolveWith((Set states) { + /// if (states.contains(WidgetState.disabled)) { + /// return SystemMouseCursors.click; + /// } + /// return SystemMouseCursors.basic; // All other states will use the default mouseCursor. + /// }), + /// ) + /// ``` + /// {@end-tool} + /// + /// If null, then [MouseCursor.defer] is used when the switch is disabled. + /// When the switch is enabled, [SystemMouseCursors.click] is used on Web, and + /// [MouseCursor.defer] is used on other platforms. + /// + /// See also: + /// + /// * [WidgetStateMouseCursor], a [MouseCursor] that implements + /// `WidgetStateProperty` which is used in APIs that need to accept + /// either a [MouseCursor] or a [WidgetStateProperty]. + final WidgetStateProperty? mouseCursor; + + /// The outline color of this [CupertinoSwitch]'s track. + /// + /// Resolved in the following states: + /// * [WidgetState.selected]. + /// * [WidgetState.hovered]. + /// * [WidgetState.focused]. + /// * [WidgetState.disabled]. + /// + /// {@tool snippet} + /// This example resolves the [trackOutlineColor] based on the current + /// [WidgetState] of the [CupertinoSwitch], providing a different [Color] when it is + /// [WidgetState.disabled]. + /// + /// ```dart + /// CupertinoSwitch( + /// value: true, + /// onChanged: (bool value) { }, + /// trackOutlineColor: WidgetStateProperty.resolveWith((Set states) { + /// if (states.contains(WidgetState.disabled)) { + /// return CupertinoColors.activeOrange.withOpacity(.48); + /// } + /// return null; // Use the default color. + /// }), + /// ) + /// ``` + /// {@end-tool} + /// + /// The [CupertinoSwitch] track has no outline by default. + final WidgetStateProperty? trackOutlineColor; + + /// The outline width of this [CupertinoSwitch]'s track. + /// + /// Resolved in the following states: + /// * [WidgetState.selected]. + /// * [WidgetState.hovered]. + /// * [WidgetState.focused]. + /// * [WidgetState.disabled]. + /// + /// {@tool snippet} + /// This example resolves the [trackOutlineWidth] based on the current + /// [WidgetState] of the [CupertinoSwitch], providing a different outline width when it is + /// [WidgetState.disabled]. + /// + /// ```dart + /// CupertinoSwitch( + /// value: true, + /// onChanged: (bool value) { }, + /// trackOutlineWidth: WidgetStateProperty.resolveWith((Set states) { + /// if (states.contains(WidgetState.disabled)) { + /// return 5.0; + /// } + /// return null; // Use the default width. + /// }), + /// ) + /// ``` + /// {@end-tool} + /// + /// Since a [CupertinoSwitch] has no track outline by default, this parameter + /// is set only if [trackOutlineColor] is provided. + /// + /// Defaults to 2.0 if a [trackOutlineColor] is provided. + final WidgetStateProperty? trackOutlineWidth; + + /// The icon to use on the thumb of this switch. + /// + /// Resolved in the following states: + /// * [WidgetState.selected]. + /// * [WidgetState.hovered]. + /// * [WidgetState.focused]. + /// * [WidgetState.disabled]. + /// + /// {@tool snippet} + /// This example resolves the [thumbIcon] based on the current + /// [WidgetState] of the [CupertinoSwitch], providing a different [Icon] when it is + /// [WidgetState.disabled]. + /// + /// ```dart + /// CupertinoSwitch( + /// value: true, + /// onChanged: (bool value) { }, + /// thumbIcon: WidgetStateProperty.resolveWith((Set states) { + /// if (states.contains(WidgetState.disabled)) { + /// return const Icon(Icons.close); + /// } + /// return null; // All other states will use the default thumbIcon. + /// }), + /// ) + /// ``` + /// {@end-tool} + /// + /// If null, then the [CupertinoSwitch] does not have any icons on the thumb. + final WidgetStateProperty? thumbIcon; + /// {@template flutter.cupertino.CupertinoSwitch.dragStartBehavior} /// Determines the way that drag start behavior is handled. /// @@ -94,7 +310,7 @@ class FormBuilderCupertinoSwitch extends FormBuilderField { super.onReset, super.focusNode, super.restorationId, - this.activeColor, + this.activeTrackColor, this.dragStartBehavior = DragStartBehavior.start, this.trackColor, this.thumbColor, @@ -103,6 +319,22 @@ class FormBuilderCupertinoSwitch extends FormBuilderField { this.helper, this.contentPadding, this.prefix, + this.focusColor, + this.inactiveThumbColor, + this.onLabelColor, + this.offLabelColor, + this.activeThumbImage, + this.onActiveThumbImageError, + this.inactiveThumbImage, + this.onInactiveThumbImageError, + this.onFocusChange, + this.autofocus = false, + this.applyTheme, + this.inactiveTrackColor, + this.mouseCursor, + this.trackOutlineColor, + this.trackOutlineWidth, + this.thumbIcon, }) : super( builder: (FormFieldState field) { final state = field as _FormBuilderCupertinoSwitchState; @@ -114,10 +346,26 @@ class FormBuilderCupertinoSwitch extends FormBuilderField { field.didChange(value); } : null, - activeColor: activeColor, dragStartBehavior: dragStartBehavior, thumbColor: thumbColor, - trackColor: trackColor, + activeTrackColor: activeTrackColor, + activeThumbImage: activeThumbImage, + inactiveThumbImage: inactiveThumbImage, + applyTheme: applyTheme, + autofocus: autofocus, + focusColor: focusColor, + focusNode: focusNode, + inactiveThumbColor: inactiveThumbColor, + inactiveTrackColor: inactiveTrackColor, + mouseCursor: mouseCursor, + onActiveThumbImageError: onActiveThumbImageError, + onInactiveThumbImageError: onInactiveThumbImageError, + offLabelColor: offLabelColor, + onLabelColor: onLabelColor, + onFocusChange: onFocusChange, + thumbIcon: thumbIcon, + trackOutlineColor: trackOutlineColor, + trackOutlineWidth: trackOutlineWidth, ); return CupertinoFormRow( error: state.hasError From bd2bb3a18c70b165fe2d55dc4c8356f095b2bc44 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Sun, 22 Dec 2024 09:56:02 +0100 Subject: [PATCH 3/5] ci: use common jobs --- .github/workflows/base.yaml | 68 ++++++------------------------------- 1 file changed, 11 insertions(+), 57 deletions(-) diff --git a/.github/workflows/base.yaml b/.github/workflows/base.yaml index a963f32..7a5a9f5 100644 --- a/.github/workflows/base.yaml +++ b/.github/workflows/base.yaml @@ -11,68 +11,22 @@ on: workflow_dispatch: +# This ensures that previous jobs for the PR are canceled when PR is updated +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: - runs-on: macos-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 # Use shallow clone for faster checkout - - - name: Check broken links - uses: JustinBeckwith/linkinator-action@v1 - with: - paths: "**/*.md" - - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: '11' - - - name: Get Flutter version by FVM - uses: kuhnroyal/flutter-fvm-config-action@v2 - id: fvm-config-action - with: - path: ".fvmrc" - - - name: Flutter action - uses: subosito/flutter-action@v2 - with: - flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} - channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} - architecture: x64 - cache: true - - - name: Install dependencies - run: flutter pub get - - name: Format code - run: dart format --set-exit-if-changed . - - name: Analyze static code - run: flutter analyze - - name: Run tests - run: flutter test --no-pub --coverage - - name: Check publish warnings - run: dart pub publish --dry-run - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - files: coverage/lcov.info - name: form_builder_cupertino_fields - - name: Build example - run: | - cd example - flutter build appbundle --debug - flutter build ios --debug --no-codesign - flutter build web + uses: flutter-form-builder-ecosystem/.github/.github/workflows/minimal-quality.yaml@main + with: + codecov-name: 'form_builder_cupertino_fields' + example: + uses: flutter-form-builder-ecosystem/.github/.github/workflows/build-examples.yaml@main deployment: permissions: id-token: write uses: flutter-form-builder-ecosystem/.github/.github/workflows/deployment.yaml@main if: ${{ github.ref_type == 'tag' }} - needs: build + needs: [build, example] From 898aedc11e9036f1e277cf74293fe73ccb367962 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Sun, 22 Dec 2024 09:58:43 +0100 Subject: [PATCH 4/5] feat: update native example setups --- example/.metadata | 34 ++--- example/android/.gitignore | 2 +- example/android/app/build.gradle | 50 ++---- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 17 ++- .../com/example/example/MainActivity.kt | 3 +- .../app/src/profile/AndroidManifest.xml | 3 +- example/android/build.gradle | 8 +- example/android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 6 +- example/ios/Flutter/AppFrameworkInfo.plist | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 144 +++++++++++++++++- .../xcshareddata/xcschemes/Runner.xcscheme | 13 +- example/ios/Runner/AppDelegate.swift | 4 +- example/ios/Runner/Info.plist | 2 - example/linux/runner/CMakeLists.txt | 26 ++++ example/linux/runner/main.cc | 6 + example/linux/runner/my_application.cc | 130 ++++++++++++++++ example/linux/runner/my_application.h | 18 +++ example/web/index.html | 25 +-- 21 files changed, 394 insertions(+), 106 deletions(-) create mode 100644 example/linux/runner/CMakeLists.txt create mode 100644 example/linux/runner/main.cc create mode 100644 example/linux/runner/my_application.cc create mode 100644 example/linux/runner/my_application.h diff --git a/example/.metadata b/example/.metadata index 87fe974..b02a7e4 100644 --- a/example/.metadata +++ b/example/.metadata @@ -1,11 +1,11 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled. +# This file should be version controlled and should not be manually edited. version: - revision: f72efea43c3013323d1b95cff571f3c1caa37583 - channel: stable + revision: "17025dd88227cd9532c33fa78f5250d548d87e9a" + channel: "stable" project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: f72efea43c3013323d1b95cff571f3c1caa37583 - base_revision: f72efea43c3013323d1b95cff571f3c1caa37583 + create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a + base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - platform: android - create_revision: f72efea43c3013323d1b95cff571f3c1caa37583 - base_revision: f72efea43c3013323d1b95cff571f3c1caa37583 + create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a + base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - platform: ios - create_revision: f72efea43c3013323d1b95cff571f3c1caa37583 - base_revision: f72efea43c3013323d1b95cff571f3c1caa37583 + create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a + base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - platform: linux - create_revision: f72efea43c3013323d1b95cff571f3c1caa37583 - base_revision: f72efea43c3013323d1b95cff571f3c1caa37583 + create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a + base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - platform: macos - create_revision: f72efea43c3013323d1b95cff571f3c1caa37583 - base_revision: f72efea43c3013323d1b95cff571f3c1caa37583 + create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a + base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - platform: web - create_revision: f72efea43c3013323d1b95cff571f3c1caa37583 - base_revision: f72efea43c3013323d1b95cff571f3c1caa37583 + create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a + base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a - platform: windows - create_revision: f72efea43c3013323d1b95cff571f3c1caa37583 - base_revision: f72efea43c3013323d1b95cff571f3c1caa37583 + create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a + base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a # User provided section diff --git a/example/android/.gitignore b/example/android/.gitignore index 6f56801..55afd91 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -7,7 +7,7 @@ gradle-wrapper.jar GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 404675e..b5511a9 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,64 +1,44 @@ plugins { id "com.android.application" id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id "dev.flutter.flutter-gradle-plugin" } -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - android { - compileSdkVersion flutter.compileSdkVersion - ndkVersion flutter.ndkVersion + namespace = "com.example.example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + jvmTarget = JavaVersion.VERSION_1_8 } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.example" + applicationId = "com.example.example" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig = signingConfigs.debug } } } flutter { - source '../..' + source = "../.." } diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index 45d523a..399f698 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + + + + + + + diff --git a/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt index e793a00..70f8f08 100644 --- a/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt +++ b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -2,5 +2,4 @@ package com.example.example import io.flutter.embedding.android.FlutterActivity -class MainActivity: FlutterActivity() { -} +class MainActivity: FlutterActivity() diff --git a/example/android/app/src/profile/AndroidManifest.xml b/example/android/app/src/profile/AndroidManifest.xml index 45d523a..399f698 100644 --- a/example/android/app/src/profile/AndroidManifest.xml +++ b/example/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,4 @@ - + - + @@ -31,29 +31,8 @@ example - - - - - + From 8b9b608ca3fd9f46dd3dc4ebb2473e88b5275d2d Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Sun, 22 Dec 2024 09:59:40 +0100 Subject: [PATCH 5/5] build: update flutter lints --- example/pubspec.lock | 8 ++++---- example/pubspec.yaml | 2 +- lib/form_builder_cupertino_fields.dart | 2 -- pubspec.yaml | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 6678bfb..821082d 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -74,10 +74,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -126,10 +126,10 @@ packages: dependency: transitive description: name: lints - sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.1.1" matcher: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index b3eb773..fb3d8cd 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -19,4 +19,4 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + flutter_lints: ">=5.0.0 <6.0.0" diff --git a/lib/form_builder_cupertino_fields.dart b/lib/form_builder_cupertino_fields.dart index 8541e2b..da027e6 100644 --- a/lib/form_builder_cupertino_fields.dart +++ b/lib/form_builder_cupertino_fields.dart @@ -1,5 +1,3 @@ -library form_builder_cupertino_fields; - export 'src/fields/form_builder_cupertino_checkbox.dart'; export 'src/fields/form_builder_cupertino_segmented_control.dart'; export 'src/fields/form_builder_cupertino_slider.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index cd21d60..1555eca 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,4 +24,4 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + flutter_lints: ">=5.0.0 <6.0.0"