a platform-dependent plugin on Flutter • Comparison with other platforms • NOT including • Topics on UI • Intro to Dart (We probably can skip the intro to Flutter ) Flutter
platform-dependent code • You can create it by either • Android Studio (with Flutter Plugin) • flutter create --org com.example --template=plugin hello Based on Dart package Flutter: Plugin System (1)
name: ReproFlutterPluginPlugin • ✅ • plugin name: repro_flutter • => generated class name: ReproFlutterPlugin ℹ TIP: The plugin’s name will become a part of the class name Flutter: Plugin System (2)
Has it’s own build.gradle file with com.android.library applied • A Pod for iOS • Has it’s own podspec • Setup dependency to native libraries as building a native library Gradle & CocoaPods serve everything! Flutter: Dependency to Native Library
the native way • i.e. Turn on Capabilities in Xcode • Commits platform specific code to the repository Flutter leaves platform specific code for edit Flutter: Project Settings
module • Cordova did the same before 2014 • Native Dependency: react-native link • Not easy for CocoaPods • Not to say Expo Underdeveloped environment for plugins . Compare: React Native
magic to add dependencies and project settings • Spec changes between versions • Processed by all of: cordova-cli, cordova-ios, cordova-android (One goes wrong can break the build) • Eventually, hook scripts can do anything (while ignoring other libraries) • Platform-specific code is considered as generated code (some people/ platform does not commit them into the repository) Doing too much on needless work because of a wrong design Compare: Cordova