Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>12.0</string>
</dict>
</plist>
13 changes: 8 additions & 5 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -127,7 +127,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -171,10 +171,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand All @@ -185,6 +187,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -272,7 +275,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -349,7 +352,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -398,7 +401,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -45,11 +46,13 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
4 changes: 4 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
87 changes: 62 additions & 25 deletions example/lib/pickers/block_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class BlockColorPickerExample extends StatefulWidget {
final List<Color> colorHistory;

@override
State<BlockColorPickerExample> createState() => _BlockColorPickerExampleState();
State<BlockColorPickerExample> createState() =>
_BlockColorPickerExampleState();
}

class _BlockColorPickerExampleState extends State<BlockColorPickerExample> {
Expand All @@ -51,28 +52,37 @@ class _BlockColorPickerExampleState extends State<BlockColorPickerExample> {
double _blurRadius = 5;
double _iconSize = 24;

Widget pickerLayoutBuilder(BuildContext context, List<Color> colors, PickerItem child) {
Widget pickerLayoutBuilder(
BuildContext context, List<Color> colors, PickerItem child) {
Orientation orientation = MediaQuery.of(context).orientation;

return SizedBox(
width: 300,
height: orientation == Orientation.portrait ? 360 : 240,
child: GridView.count(
crossAxisCount: orientation == Orientation.portrait ? _portraitCrossAxisCount : _landscapeCrossAxisCount,
crossAxisCount: orientation == Orientation.portrait
? _portraitCrossAxisCount
: _landscapeCrossAxisCount,
crossAxisSpacing: 5,
mainAxisSpacing: 5,
children: [for (Color color in colors) child(color)],
),
);
}

Widget pickerItemBuilder(Color color, bool isCurrentColor, void Function() changeColor) {
Widget pickerItemBuilder(
Color color, bool isCurrentColor, void Function() changeColor) {
return Container(
margin: const EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(_borderRadius),
color: color,
boxShadow: [BoxShadow(color: color.withOpacity(0.8), offset: const Offset(1, 2), blurRadius: _blurRadius)],
boxShadow: [
BoxShadow(
color: color.withValues(alpha: 0.8),
offset: const Offset(1, 2),
blurRadius: _blurRadius)
],
),
child: Material(
color: Colors.transparent,
Expand Down Expand Up @@ -131,10 +141,13 @@ Widget pickerLayoutBuilder(BuildContext context, List<Color> colors, PickerItem
},
);
},
child: Icon(Icons.code, color: useWhiteForeground(widget.pickerColor) ? Colors.white : Colors.black),
child: Icon(Icons.code,
color: useWhiteForeground(widget.pickerColor)
? Colors.white
: Colors.black),
style: ElevatedButton.styleFrom(
backgroundColor: widget.pickerColor,
shadowColor: widget.pickerColor.withOpacity(1),
shadowColor: widget.pickerColor.withValues(alpha: 1),
elevation: 10,
),
),
Expand All @@ -150,7 +163,8 @@ Widget pickerLayoutBuilder(BuildContext context, List<Color> colors, PickerItem
max: 10,
divisions: 9,
label: _portraitCrossAxisCount.toString(),
onChanged: (double value) => setState(() => _portraitCrossAxisCount = value.round()),
onChanged: (double value) =>
setState(() => _portraitCrossAxisCount = value.round()),
),
),
),
Expand All @@ -165,7 +179,8 @@ Widget pickerLayoutBuilder(BuildContext context, List<Color> colors, PickerItem
max: 10,
divisions: 9,
label: _landscapeCrossAxisCount.toString(),
onChanged: (double value) => setState(() => _landscapeCrossAxisCount = value.round()),
onChanged: (double value) =>
setState(() => _landscapeCrossAxisCount = value.round()),
),
),
),
Expand All @@ -189,7 +204,7 @@ Widget pickerItemBuilder(Color color, bool isCurrentColor, void Function() chang
decoration: BoxDecoration(
borderRadius: BorderRadius.circular($_borderRadius),
color: color,
boxShadow: [BoxShadow(color: color.withOpacity(0.8), offset: const Offset(1, 2), blurRadius: $_blurRadius)],
boxShadow: [BoxShadow(color: color.withValues(alpha:0.8), offset: const Offset(1, 2), blurRadius: $_blurRadius)],
),
child: Material(
color: Colors.transparent,
Expand All @@ -216,10 +231,13 @@ Widget pickerItemBuilder(Color color, bool isCurrentColor, void Function() chang
},
);
},
child: Icon(Icons.code, color: useWhiteForeground(widget.pickerColor) ? Colors.white : Colors.black),
child: Icon(Icons.code,
color: useWhiteForeground(widget.pickerColor)
? Colors.white
: Colors.black),
style: ElevatedButton.styleFrom(
backgroundColor: widget.pickerColor,
shadowColor: widget.pickerColor.withOpacity(1),
shadowColor: widget.pickerColor.withValues(alpha: 1),
elevation: 10,
),
),
Expand All @@ -235,7 +253,8 @@ Widget pickerItemBuilder(Color color, bool isCurrentColor, void Function() chang
max: 30,
divisions: 30,
label: _borderRadius.toString(),
onChanged: (double value) => setState(() => _borderRadius = value.round().toDouble()),
onChanged: (double value) =>
setState(() => _borderRadius = value.round().toDouble()),
),
),
),
Expand All @@ -250,7 +269,8 @@ Widget pickerItemBuilder(Color color, bool isCurrentColor, void Function() chang
max: 5,
divisions: 5,
label: _blurRadius.toString(),
onChanged: (double value) => setState(() => _blurRadius = value.round().toDouble()),
onChanged: (double value) =>
setState(() => _blurRadius = value.round().toDouble()),
),
),
),
Expand All @@ -265,7 +285,8 @@ Widget pickerItemBuilder(Color color, bool isCurrentColor, void Function() chang
max: 50,
divisions: 49,
label: _iconSize.toString(),
onChanged: (double value) => setState(() => _iconSize = value.round().toDouble()),
onChanged: (double value) =>
setState(() => _iconSize = value.round().toDouble()),
),
),
),
Expand All @@ -286,7 +307,9 @@ Widget pickerItemBuilder(Color color, bool isCurrentColor, void Function() chang
child: BlockPicker(
pickerColor: widget.pickerColor,
onColorChanged: widget.onColorChanged,
availableColors: widget.colorHistory.isNotEmpty ? widget.colorHistory : colors,
availableColors: widget.colorHistory.isNotEmpty
? widget.colorHistory
: colors,
layoutBuilder: pickerLayoutBuilder,
itemBuilder: pickerItemBuilder,
),
Expand All @@ -297,11 +320,14 @@ Widget pickerItemBuilder(Color color, bool isCurrentColor, void Function() chang
},
child: Text(
'Blocky Color Picker',
style: TextStyle(color: useWhiteForeground(widget.pickerColor) ? Colors.white : Colors.black),
style: TextStyle(
color: useWhiteForeground(widget.pickerColor)
? Colors.white
: Colors.black),
),
style: ElevatedButton.styleFrom(
backgroundColor: widget.pickerColor,
shadowColor: widget.pickerColor.withOpacity(1),
shadowColor: widget.pickerColor.withValues(alpha: 1),
elevation: 10,
),
),
Expand Down Expand Up @@ -331,10 +357,13 @@ BlockPicker(
},
);
},
child: Icon(Icons.code, color: useWhiteForeground(widget.pickerColor) ? Colors.white : Colors.black),
child: Icon(Icons.code,
color: useWhiteForeground(widget.pickerColor)
? Colors.white
: Colors.black),
style: ElevatedButton.styleFrom(
backgroundColor: widget.pickerColor,
shadowColor: widget.pickerColor.withOpacity(1),
shadowColor: widget.pickerColor.withValues(alpha: 1),
elevation: 10,
),
),
Expand All @@ -358,7 +387,9 @@ BlockPicker(
child: MultipleChoiceBlockPicker(
pickerColors: widget.pickerColors,
onColorsChanged: widget.onColorsChanged,
availableColors: widget.colorHistory.isNotEmpty ? widget.colorHistory : colors,
availableColors: widget.colorHistory.isNotEmpty
? widget.colorHistory
: colors,
layoutBuilder: pickerLayoutBuilder,
itemBuilder: pickerItemBuilder,
),
Expand All @@ -369,11 +400,14 @@ BlockPicker(
},
child: Text(
'Multiple selection Blocky Color Picker',
style: TextStyle(color: useWhiteForeground(widget.pickerColor) ? Colors.white : Colors.black),
style: TextStyle(
color: useWhiteForeground(widget.pickerColor)
? Colors.white
: Colors.black),
),
style: ElevatedButton.styleFrom(
backgroundColor: widget.pickerColor,
shadowColor: widget.pickerColor.withOpacity(1),
shadowColor: widget.pickerColor.withValues(alpha: 1),
elevation: 10,
),
),
Expand Down Expand Up @@ -403,10 +437,13 @@ MultipleChoiceBlockPicker(
},
);
},
child: Icon(Icons.code, color: useWhiteForeground(widget.pickerColor) ? Colors.white : Colors.black),
child: Icon(Icons.code,
color: useWhiteForeground(widget.pickerColor)
? Colors.white
: Colors.black),
style: ElevatedButton.styleFrom(
backgroundColor: widget.pickerColor,
shadowColor: widget.pickerColor.withOpacity(1),
shadowColor: widget.pickerColor.withValues(alpha: 1),
elevation: 10,
),
),
Expand Down
Loading