You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[pigeon] default member fields values are ignored after code generation #80048
changed the title [-][pigeon] default arguments are ignored after code generation[/-][+][pigeon] default member fields values are ignored after code generation[/+]on Apr 8, 2021
This is works as designed. It wasn't implemented as of yet since we're being very careful about addressing the core need. This is a good idea as we consider new features.
Hello. As of testing this with version 3.0.3, pigeon throws the following error:
Error: pigeons/messages.dart:2: Initialization isn't supported for fields in Pigeon data classes ("String? string = "some version";"), just use nullable types with no initializer (example "int? x;").
Tested this on both stable and master channels of Flutter
Code sample used
classVersion {
String? string ="some version";
}
flutter doctor -v (Stable)
[✓] Flutter (Channel stable, 3.0.0, on macOS 12.3.1 21E258 darwin-arm, locale en-US)
• Flutter version 3.0.0 at /Users/nabeelparkar/fvm/versions/stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ee4e09cce0 (7 days ago), 2022-05-09 16:45:18 -0700
• Engine revision d1b9a6938a
• Dart version 2.17.0
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/nabeelparkar/Library/Android/sdk/
• Platform android-32, build-tools 32.1.0-rc1
• ANDROID_SDK_ROOT = /Users/nabeelparkar/Library/Android/sdk/
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• CHROME_EXECUTABLE = /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.1.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 67.1.4
• Dart plugin version 221.5591.52
[✓] VS Code (version 1.67.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.40.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.3.1 21E258 darwin-arm
• Chrome (web) • chrome • web-javascript • Brave Browser 101.1.38.115
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
flutter doctor -v (Master)
[✓] Flutter (Channel master, 3.1.0-0.0.pre.733, on macOS 12.3.1 21E258 darwin-arm, locale en-US)
• Flutter version 3.1.0-0.0.pre.733 at /Users/nabeelparkar/fvm/versions/master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c60936e5c9 (14 hours ago), 2022-05-16 13:04:12 -0400
• Engine revision aeab8402c6
• Dart version 2.18.0 (build 2.18.0-117.0.dev)
• DevTools version 2.13.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/nabeelparkar/Library/Android/sdk/
• Platform android-32, build-tools 32.1.0-rc1
• ANDROID_SDK_ROOT = /Users/nabeelparkar/Library/Android/sdk/
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• CHROME_EXECUTABLE = /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.1.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 67.1.4
• Dart plugin version 221.5591.52
[✓] VS Code (version 1.67.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.40.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.3.1 21E258 darwin-arm
• Chrome (web) • chrome • web-javascript • Brave Browser 101.1.38.115
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!```
</details>
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[-][pigeon] default arguments are ignored after code generation[/-][+][pigeon] default member fields values are ignored after code generation[/+]TahaTesser commentedon Apr 9, 2021
Hi @MatrixDev
Thanks for filing the issue, I can reproduce the issue
after
flutter pub run pigeon \ --input pigeons/messages.dart \ --dart_out lib/messages.dart \ --objc_header_out ios/Classes/messages.h \ --objc_source_out ios/Classes/messages.m \ --objc_prefix FLT \ --java_out android/src/main/java/com/example/pigeon_plugin/Messages.java \ --java_package "com.example.pigeon_plugin"https://github.com/gaaclarke/pigeon_plugin_example needs to be updated for null safety changes
gaaclarke commentedon Jun 14, 2021
This is works as designed. It wasn't implemented as of yet since we're being very careful about addressing the core need. This is a good idea as we consider new features.
exaby73 commentedon May 13, 2022
Hello. As of testing this with version
3.0.3, pigeon throws the following error:Tested this on both stable and master channels of Flutter
Code sample used
flutter doctor -v(Stable)flutter doctor -v(Master)[pigeon] isEnum, isClass, fix swift casting, default values, optional…
github-actions commentedon Dec 2, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[pigeon] isEnum, isClass, fix swift casting, default values, optional…
[pigeon] isEnum, isClass, fix swift casting, default values, optional…