Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
deandreamatias authored Oct 27, 2024
2 parents 5fb23f4 + 3cd4f18 commit 38e9ef4
Show file tree
Hide file tree
Showing 23 changed files with 301 additions and 169 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1 # Use shallow clone for faster checkout

- name: Check broken links
uses: JustinBeckwith/linkinator-action@v1
Expand All @@ -34,10 +36,18 @@ jobs:
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:
channel: 'stable'
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
architecture: x64
cache: true

- name: Install dependencies
Expand Down Expand Up @@ -65,19 +75,8 @@ jobs:
flutter build web
deployment:
if: ${{ github.ref_type == 'tag' }}
needs: build
name: Deploy package
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- name: Flutter action
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Publish package
run: dart pub publish -v -f
uses: flutter-form-builder-ecosystem/.github/.github/workflows/deployment.yaml@main
if: ${{ github.ref_type == 'tag' }}
needs: build
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: PR Conventional Commit Validation
uses: ytanikin/PRConventionalCommits@1.2.0
uses: ytanikin/PRConventionalCommits@1.3.0
with:
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]'
add_label: 'false'
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# [9.5.0]

## Fixes

* #1350: valueTransformer transform values to null
* #1416: Added missing TextField properties to FormBuilderTextField
* #1398: Add hint to FormBuilderDropdown
* #1317: Added new property to form_builder_choice_chip

# 9.4.1

## Features

* `FormBuilderTextField` Add missing fields from TextField

## Other

* ci: replace deployment jobs for reuse workflow

# 9.4.0

## Fixes

* #1388 Respect latest field's initial value (esp when its forcefully recreated)

## Features

* `FormBuilderTextField` #1334 set enableSuggestions default to true
* Replace deprecated property onPopInvoked
* Use elevated button on main example
* Update android settings on example

## Chores

* Set minimal Flutter version to 3.24.0
* Set minimal Dart version to 3.5.0

# [9.3.0]

* Set minimal Flutter version to 3.22.0
Expand Down
3 changes: 0 additions & 3 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

Expand Down
25 changes: 9 additions & 16 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,13 +22,9 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace "dev.danvickmiller.flutterformbuilder.example"
compileSdkVersion 33
compileSdkVersion 34
ndkVersion flutter.ndkVersion

compileOptions {
Expand All @@ -48,8 +45,8 @@ android {
applicationId "dev.danvickmiller.flutterformbuilder.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 16
targetSdkVersion 33
minSdkVersion flutter.minSdkVersion
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -66,7 +63,3 @@ android {
flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
15 changes: 1 addition & 14 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand All @@ -26,4 +13,4 @@ subprojects {

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
}
30 changes: 22 additions & 8 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
}

include ":app"
29 changes: 11 additions & 18 deletions example/lib/sources/complete_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -320,23 +320,20 @@ class _CompleteFormState extends State<CompleteForm> {
],
),
),
const SizedBox(height: 8),
Row(
children: <Widget>[
Expanded(
child: ElevatedButton(
onPressed: () {
if (_formKey.currentState?.saveAndValidate() ?? false) {
debugPrint(_formKey.currentState?.value.toString());
} else {
debugPrint(_formKey.currentState?.value.toString());
debugPrint('validation failed');
}
},
child: const Text(
'Submit',
style: TextStyle(color: Colors.white),
),
),
onPressed: () {
if (_formKey.currentState?.saveAndValidate() ?? false) {
debugPrint(_formKey.currentState?.value.toString());
} else {
debugPrint(_formKey.currentState?.value.toString());
debugPrint('validation failed');
}
},
child: const Text('Submit')),
),
const SizedBox(width: 20),
Expanded(
Expand All @@ -345,11 +342,7 @@ class _CompleteFormState extends State<CompleteForm> {
_formKey.currentState?.reset();
},
// color: Theme.of(context).colorScheme.secondary,
child: Text(
'Reset',
style: TextStyle(
color: Theme.of(context).colorScheme.secondary),
),
child: const Text('Reset'),
),
),
],
Expand Down
8 changes: 2 additions & 6 deletions example/lib/sources/conditional_fields.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ class _ConditionalFieldsState extends State<ConditionalFields> {
child: const Text('Magic info'),
),
const SizedBox(height: 10),
MaterialButton(
color: Theme.of(context).colorScheme.secondary,
child: const Text(
"Submit",
style: TextStyle(color: Colors.white),
),
ElevatedButton(
child: const Text("Submit"),
onPressed: () {
_formKey.currentState!.saveAndValidate();
debugPrint(_formKey.currentState?.instantValue.toString() ?? '');
Expand Down
16 changes: 4 additions & 12 deletions example/lib/sources/custom_fields.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,8 @@ class _CustomFieldsState extends State<CustomFields> {
Row(
children: <Widget>[
Expanded(
child: MaterialButton(
color: Theme.of(context).colorScheme.secondary,
child: const Text(
"Submit",
style: TextStyle(color: Colors.white),
),
child: ElevatedButton(
child: const Text("Submit"),
onPressed: () {
_formKey.currentState!.save();
if (_formKey.currentState!.validate()) {
Expand All @@ -98,12 +94,8 @@ class _CustomFieldsState extends State<CustomFields> {
),
const SizedBox(width: 20),
Expanded(
child: MaterialButton(
color: Theme.of(context).colorScheme.secondary,
child: const Text(
"Reset",
style: TextStyle(color: Colors.white),
),
child: ElevatedButton(
child: const Text("Reset"),
onPressed: () {
_formKey.currentState!.reset();
},
Expand Down
16 changes: 4 additions & 12 deletions example/lib/sources/dynamic_fields.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@ class _DynamicFieldsState extends State<DynamicFields> {
Row(
children: <Widget>[
Expanded(
child: MaterialButton(
color: Theme.of(context).colorScheme.secondary,
child: const Text(
"Submit",
style: TextStyle(color: Colors.white),
),
child: ElevatedButton(
child: const Text("Submit"),
onPressed: () {
_formKey.currentState!.saveAndValidate();
setState(() {
Expand All @@ -63,12 +59,8 @@ class _DynamicFieldsState extends State<DynamicFields> {
),
const SizedBox(width: 20),
Expanded(
child: MaterialButton(
color: Theme.of(context).colorScheme.secondary,
child: const Text(
"Add field",
style: TextStyle(color: Colors.white),
),
child: ElevatedButton(
child: const Text("Add field"),
onPressed: () {
final newTextFieldName = 'name_${_newTextFieldId++}';
final newTextFieldKey = ValueKey(_newTextFieldId);
Expand Down
8 changes: 2 additions & 6 deletions example/lib/sources/related_fields.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@ class _RelatedFieldsState extends State<RelatedFields> {
.toList(),
),
const SizedBox(height: 10),
MaterialButton(
color: Theme.of(context).colorScheme.secondary,
child: const Text(
"Submit",
style: TextStyle(color: Colors.white),
),
ElevatedButton(
child: const Text("Submit"),
onPressed: () {
_formKey.currentState!.saveAndValidate();
debugPrint(_formKey.currentState?.instantValue.toString() ?? '');
Expand Down
6 changes: 2 additions & 4 deletions example/lib/sources/signup_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ class _SignupFormState extends State<SignupForm> {
},
),
const SizedBox(height: 10),
MaterialButton(
color: Theme.of(context).colorScheme.secondary,
ElevatedButton(
onPressed: () {
if (_formKey.currentState?.saveAndValidate() ?? false) {
if (true) {
Expand All @@ -103,8 +102,7 @@ class _SignupFormState extends State<SignupForm> {
}
debugPrint(_formKey.currentState?.value.toString());
},
child:
const Text('Signup', style: TextStyle(color: Colors.white)),
child: const Text('Signup'),
)
],
),
Expand Down
Loading

0 comments on commit 38e9ef4

Please sign in to comment.