From 1ac92749c0207d4c0ff1cb18f482e96fe247ff6c Mon Sep 17 00:00:00 2001 From: Dawei Chen Date: Wed, 2 Sep 2026 14:08:28 +1000 Subject: [PATCH 1/5] Update ignore list for analyzer --- analysis_options.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/analysis_options.yaml b/analysis_options.yaml index 42239ef..3f6e284 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -28,3 +28,4 @@ analyzer: exclude: - ignore/** - ignore/ + - build/** From 84d39f027c7b22c50dc3c34cf60615fbd29c38f0 Mon Sep 17 00:00:00 2001 From: Dawei Chen Date: Wed, 2 Sep 2026 14:08:48 +1000 Subject: [PATCH 2/5] Update dependency --- pubspec.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index b0ff0ae..bac9632 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,15 +18,15 @@ dependencies: flutter: sdk: flutter - audioplayers: ^6.5.1 - file_picker: ^11.0.2 - flutter_markdown_plus: ^1.0.7 + audioplayers: ^6.8.1 + file_picker: ^12.1.2 + flutter_markdown_plus: ^1.0.12 http: ^1.6.0 media_kit: ^1.2.6 media_kit_libs_video: ^1.0.7 media_kit_video: ^2.0.1 path: ^1.9.1 - path_provider: ^2.1.5 + path_provider: ^2.1.6 # universal_html: ^2.3.0 universal_web: ^1.1.1+1 url_launcher: ^6.3.2 @@ -34,7 +34,7 @@ dependencies: dev_dependencies: custom_lint: ^0.8.1 flutter_lints: ^6.0.0 - import_order_lint: ^0.2.2 + import_order_lint: ^0.2.3 flutter: uses-material-design: true From d9946a706588070aab39418db70134ad2e4ae3ed Mon Sep 17 00:00:00 2001 From: Dawei Chen Date: Wed, 2 Sep 2026 14:09:07 +1000 Subject: [PATCH 3/5] Use file_picker v12 API --- lib/src/widgets/button_file_saver.dart | 43 +++++++++++++------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/lib/src/widgets/button_file_saver.dart b/lib/src/widgets/button_file_saver.dart index af926d4..44e9a6c 100644 --- a/lib/src/widgets/button_file_saver.dart +++ b/lib/src/widgets/button_file_saver.dart @@ -24,12 +24,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. /// -/// Authors: Tony Chen +/// Authors: Tony Chen, Dawei Chen library; import 'dart:convert'; -import 'dart:io' show File; import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; @@ -129,35 +128,35 @@ Future saveDataForNonWeb( ) async { final messenger = ScaffoldMessenger.of(context); - String? selectedFile = await FilePicker.saveFile( - dialogTitle: 'Please choose a filename and path to save the result', - fileName: defaultFileName, - type: FileType.custom, - allowedExtensions: ['json'], - ); - - if (selectedFile != null) { - final file = File(selectedFile); + try { final jsonContent = jsonEncoder.convert(data); - try { - await file.writeAsString(jsonContent); - debugPrint('File saved at $selectedFile'); + final selectedFileUri = await FilePicker.saveFile( + dialogTitle: 'Please choose a filename and path to save the result', + fileName: defaultFileName, + bytes: utf8.encode(jsonContent), + mimeType: 'application/json', + type: FileType.custom, + allowedExtensions: ['json'], + ); + + if (selectedFileUri != null) { + debugPrint('File saved at $selectedFileUri'); messenger.showSnackBar( - SnackBar(content: Text('Data saved as $selectedFile')), + SnackBar(content: Text('Data saved as $selectedFileUri')), ); - } catch (e) { - debugPrint('Error saving file: $e'); - + } else { + debugPrint('Save file dialog was cancelled.'); messenger.showSnackBar( - SnackBar(content: Text('Error saving file: $e')), + const SnackBar(content: Text('Save cancelled.')), ); } - } else { - debugPrint('Save file dialog was cancelled.'); + } catch (e) { + debugPrint('Error saving file: $e'); + messenger.showSnackBar( - const SnackBar(content: Text('Save cancelled.')), + SnackBar(content: Text('Error saving file: $e')), ); } } From 10e8e90f200aeab9f1816a661baffbc9e1d4f9b8 Mon Sep 17 00:00:00 2001 From: Dawei Chen Date: Wed, 2 Sep 2026 14:16:18 +1000 Subject: [PATCH 4/5] Update Flutter version used in workflow --- .github/workflows/ci.yaml | 2 +- .github/workflows/installers.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7ed98a1..e8de460 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ on: types: [opened, reopened, synchronize] env: - FLUTTER_VERSION: '3.41.7' + FLUTTER_VERSION: 3.x jobs: diff --git a/.github/workflows/installers.yaml b/.github/workflows/installers.yaml index 0a68668..7103178 100644 --- a/.github/workflows/installers.yaml +++ b/.github/workflows/installers.yaml @@ -48,7 +48,7 @@ env: MACOS_APP_RELEASE_UNSIGNED_PATH: build/macos/Build/Products/Release-unsigned MACOS_APP_RELEASE_STAGING_PATH: build/macos/Build/Products/Release-staging MACOS_APP_RELEASE_DEV_PATH: build/macos/Build/Products/Release-dev - FLUTTER_VERSION: "3.41.7" + FLUTTER_VERSION: 3.x jobs: From 5b5f68a8ac971815a1d77bfc76b07f004263eb52 Mon Sep 17 00:00:00 2001 From: Dawei Chen Date: Wed, 2 Sep 2026 17:02:38 +1000 Subject: [PATCH 5/5] Bump version to 0.0.13 --- CHANGELOG.md | 1 + pubspec.yaml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae84316..64b3aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ utilised by the flutter version_widget package. ## 0.1 Stable beta release ++ Use file_picker v12.x API [0.0.13] + Remove null/empty values from output JSON [0.0.12 20260511 tonypioneer] + Update file_picker dependency [0.0.11 20260424 anushkavid] + Migrate to universal_web to allow native web build [0.0.10 20260217 dc] diff --git a/pubspec.yaml b/pubspec.yaml index bac9632..3c8b602 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: markdown_widget_builder description: "Widget builder for surveys defined using markdown-like syntax." -version: 0.0.12 +version: 0.0.13 homepage: https://github.com/anusii/markdown_widget_builder environment: @@ -19,7 +19,7 @@ dependencies: sdk: flutter audioplayers: ^6.8.1 - file_picker: ^12.1.2 + file_picker: ^12.1.3 flutter_markdown_plus: ^1.0.12 http: ^1.6.0 media_kit: ^1.2.6