There are many platform constants that need to be sync on dart side and platform side. Following are the constants that are being generated:
- codec types
- platform method and event names
- serializable property names for serialization and de-serialization
cd bin
dart codegen.dartA straight forward templates creating using dart string interpolation:
source template files are available in bin/templates
and source context data in bin/codegencontext.dart.
These files are generated/modified upon code generation
lib/src/generated/platformconstants.dartfor use in Flutter/Dartandroid/src/main/java/io/ably/flutter/plugin/generated/PlatformConstants.javafor use in Android/Javaios/Classes/codec/AblyPlatformConstants.hfor use in iOS/Objective-Cios/Classes/codec/AblyPlatformConstants.mfor use in iOS/Objective-C
When any of the below need to be added/updated
- A new codec type - required when a new top level serializable object is required (ex:
ErrorInfoandClientOptions) - Platform and event names - when implementing a new method in
MethodChannelor new event inEventChannel - A new object needs to be serialized (either top-level, or nested)
- Test that everything still works
- Commit changes to the template(s)
- Commit changes to the generate files