v3.0.0ios_color_picker
一個為所有 Flutter 平台提供 iOS 風格顏色選擇器 UI 的 Flutter 套件,同時在 iOS 上提供原生 iOS 顏色選擇器。
一個全新的 Flutter 套件,為所有平台(Web、Android、iOS)提供克隆的原生 iOS 顏色選擇器介面,同時也僅在 iOS 上提供原生 iOS 選擇器
{"sdk":"flutter"}^2.5.5^2.0.1^2.1.1{"sdk":"flutter"}^1.1.1^2.1.8{"sdk":"flutter"}^6.0.0以下為英文專案原文快照,最新內容請造訪 GitHub。
A Flutter package that provides an iOS-style color picker UI for every Flutter platform, plus access to the native iOS color picker on iOS.
Add the package and create a controller. Dispose the controller from your
widget's dispose method because the native iOS picker streams color changes
through an event channel.
final iosColorPickerController = IOSColorPickerController();
/// Native iOS Color Picker
ElevatedButton(
onPressed: () {
iosColorPickerController.showNativeIosColorPicker(
startingColor: backgroundColor,
darkMode: true,
onColorChanged: (color) {
setState(() {
backgroundColor = color;
});
},
);
},
child: Text("Native iOS"),
),
/// Custom iOS Color Picker (for all platforms)
ElevatedButton(
onPressed: () {
iosColorPickerController.showIOSCustomColorPicker(
startingColor: backgroundColor,
onColorChanged: (color) {
setState(() {
backgroundColor = color;
});
},
context: context,
);
},
child: Text("Custom iOS for all"),
),
Dispose the controller:
final IOSColorPickerController iosColorPickerController =
IOSColorPickerController();
@override
void dispose() {
iosColorPickerController.dispose();
super.dispose();
}
Run the app in the example/ folder to explore the plugin.
For more updates and inquiries, connect with me on LinkedIn: