Skip to content

Commit 0fbb256

Browse files
committed
fix: update example
1 parent c847817 commit 0fbb256

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+438
-390
lines changed

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>8.0</string>
24+
<string>13.0</string>
2525
</dict>
2626
</plist>

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -135,7 +135,7 @@
135135
97C146E61CF9000F007C117D /* Project object */ = {
136136
isa = PBXProject;
137137
attributes = {
138-
LastUpgradeCheck = 1020;
138+
LastUpgradeCheck = 1510;
139139
ORGANIZATIONNAME = "The Chromium Authors";
140140
TargetAttributes = {
141141
97C146ED1CF9000F007C117D = {
@@ -179,10 +179,12 @@
179179
/* Begin PBXShellScriptBuildPhase section */
180180
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
181181
isa = PBXShellScriptBuildPhase;
182+
alwaysOutOfDate = 1;
182183
buildActionMask = 2147483647;
183184
files = (
184185
);
185186
inputPaths = (
187+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
186188
);
187189
name = "Thin Binary";
188190
outputPaths = (
@@ -193,6 +195,7 @@
193195
};
194196
9740EEB61CF901F6004384FC /* Run Script */ = {
195197
isa = PBXShellScriptBuildPhase;
198+
alwaysOutOfDate = 1;
196199
buildActionMask = 2147483647;
197200
files = (
198201
);
@@ -280,7 +283,7 @@
280283
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
281284
GCC_WARN_UNUSED_FUNCTION = YES;
282285
GCC_WARN_UNUSED_VARIABLE = YES;
283-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
286+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
284287
MTL_ENABLE_DEBUG_INFO = NO;
285288
SDKROOT = iphoneos;
286289
SUPPORTED_PLATFORMS = iphoneos;
@@ -362,7 +365,7 @@
362365
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
363366
GCC_WARN_UNUSED_FUNCTION = YES;
364367
GCC_WARN_UNUSED_VARIABLE = YES;
365-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
368+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
366369
MTL_ENABLE_DEBUG_INFO = YES;
367370
ONLY_ACTIVE_ARCH = YES;
368371
SDKROOT = iphoneos;
@@ -411,7 +414,7 @@
411414
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
412415
GCC_WARN_UNUSED_FUNCTION = YES;
413416
GCC_WARN_UNUSED_VARIABLE = YES;
414-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
417+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
415418
MTL_ENABLE_DEBUG_INFO = NO;
416419
SDKROOT = iphoneos;
417420
SUPPORTED_PLATFORMS = iphoneos;

example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -45,11 +46,13 @@
4546
buildConfiguration = "Debug"
4647
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4748
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4850
launchStyle = "0"
4951
useCustomWorkingDirectory = "NO"
5052
ignoresPersistentStateOnLaunch = "NO"
5153
debugDocumentVersioning = "YES"
5254
debugServiceExtension = "internal"
55+
enableGPUValidationMode = "1"
5356
allowLocationSimulation = "YES">
5457
<BuildableProductRunnable
5558
runnableDebuggingMode = "0">

example/ios/Runner/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22
import Flutter
33

4-
@UIApplicationMain
4+
@main
55
@objc class AppDelegate: FlutterAppDelegate {
66
override func application(
77
_ application: UIApplication,

example/ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,9 @@
4141
</array>
4242
<key>UIViewControllerBasedStatusBarAppearance</key>
4343
<false/>
44+
<key>CADisableMinimumFrameDurationOnPhone</key>
45+
<true/>
46+
<key>UIApplicationSupportsIndirectInputEvents</key>
47+
<true/>
4448
</dict>
4549
</plist>

example/lib/accessibility/neumorphic_accessibility.dart

Lines changed: 67 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class __PageState extends State<_Page> {
3939
double height = 150.0;
4040
double width = 150.0;
4141

42-
Color borderColor;
43-
double borderWidth;
42+
Color? borderColor;
43+
double? borderWidth;
4444

4545
static final minWidth = 50.0;
4646
static final maxWidth = 200.0;
@@ -67,10 +67,12 @@ class __PageState extends State<_Page> {
6767
Padding(
6868
padding:
6969
const EdgeInsets.only(left: 8.0, right: 8.0, top: 8.0),
70-
child: RaisedButton(
71-
shape: RoundedRectangleBorder(
72-
borderRadius: BorderRadius.circular(12)),
73-
color: Theme.of(context).colorScheme.secondary,
70+
child: ElevatedButton(
71+
style: ElevatedButton.styleFrom(
72+
shape: RoundedRectangleBorder(
73+
borderRadius: BorderRadius.circular(12)),
74+
backgroundColor: Theme.of(context).colorScheme.secondary,
75+
),
7476
child: Text(
7577
"back",
7678
style: TextStyle(color: Colors.white),
@@ -123,12 +125,14 @@ class __PageState extends State<_Page> {
123125
flex: 1,
124126
child: Padding(
125127
padding: const EdgeInsets.all(8.0),
126-
child: RaisedButton(
127-
shape: RoundedRectangleBorder(
128-
borderRadius: BorderRadius.circular(12)),
129-
color: selectedConfiguratorIndex == 0
130-
? buttonActiveColor
131-
: buttonInnactiveColor,
128+
child: ElevatedButton(
129+
style: ElevatedButton.styleFrom(
130+
shape: RoundedRectangleBorder(
131+
borderRadius: BorderRadius.circular(12)),
132+
backgroundColor: selectedConfiguratorIndex == 0
133+
? buttonActiveColor
134+
: buttonInnactiveColor,
135+
),
132136
child: Text(
133137
"Style",
134138
style: TextStyle(
@@ -149,9 +153,14 @@ class __PageState extends State<_Page> {
149153
flex: 1,
150154
child: Padding(
151155
padding: const EdgeInsets.all(8.0),
152-
child: RaisedButton(
153-
shape: RoundedRectangleBorder(
154-
borderRadius: BorderRadius.circular(12)),
156+
child: ElevatedButton(
157+
style: ElevatedButton.styleFrom(
158+
shape: RoundedRectangleBorder(
159+
borderRadius: BorderRadius.circular(12)),
160+
backgroundColor: selectedConfiguratorIndex == 1
161+
? buttonActiveColor
162+
: buttonInnactiveColor,
163+
),
155164
child: Text(
156165
"Element",
157166
style: TextStyle(
@@ -160,9 +169,6 @@ class __PageState extends State<_Page> {
160169
: textInactiveColor,
161170
),
162171
),
163-
color: selectedConfiguratorIndex == 1
164-
? buttonActiveColor
165-
: buttonInnactiveColor,
166172
onPressed: () {
167173
setState(() {
168174
selectedConfiguratorIndex = 1;
@@ -175,9 +181,14 @@ class __PageState extends State<_Page> {
175181
flex: 1,
176182
child: Padding(
177183
padding: const EdgeInsets.all(8.0),
178-
child: RaisedButton(
179-
shape: RoundedRectangleBorder(
180-
borderRadius: BorderRadius.circular(12)),
184+
child: ElevatedButton(
185+
style: ElevatedButton.styleFrom(
186+
shape: RoundedRectangleBorder(
187+
borderRadius: BorderRadius.circular(12)),
188+
backgroundColor: selectedConfiguratorIndex == 2
189+
? buttonActiveColor
190+
: buttonInnactiveColor,
191+
),
181192
child: Text(
182193
"Border",
183194
style: TextStyle(
@@ -186,9 +197,6 @@ class __PageState extends State<_Page> {
186197
: textInactiveColor,
187198
),
188199
),
189-
color: selectedConfiguratorIndex == 2
190-
? buttonActiveColor
191-
: buttonInnactiveColor,
192200
onPressed: () {
193201
setState(() {
194202
selectedConfiguratorIndex = 2;
@@ -209,15 +217,14 @@ class __PageState extends State<_Page> {
209217
switch (selectedConfiguratorIndex) {
210218
case 0:
211219
return styleCustomizer();
212-
break;
220+
213221
case 1:
214222
return elementCustomizer();
215-
break;
223+
216224
case 2:
217225
return borderCustomizer();
218-
break;
219226
}
220-
return null;
227+
return const SizedBox.shrink();
221228
}
222229

223230
Widget styleCustomizer() {
@@ -267,7 +274,7 @@ class __PageState extends State<_Page> {
267274
onColorChanged: (color) {
268275
setState(() {
269276
NeumorphicTheme.of(context)
270-
.updateCurrentTheme(NeumorphicThemeData(baseColor: color));
277+
?.updateCurrentTheme(NeumorphicThemeData(baseColor: color));
271278
});
272279
},
273280
color: NeumorphicTheme.baseColor(context),
@@ -292,7 +299,7 @@ class __PageState extends State<_Page> {
292299
borderColor = color;
293300
});
294301
},
295-
color: borderColor,
302+
color: borderColor ?? Colors.transparent,
296303
),
297304
],
298305
);
@@ -370,7 +377,7 @@ class __PageState extends State<_Page> {
370377
child: Slider(
371378
min: 0,
372379
max: 10,
373-
value: borderWidth,
380+
value: borderWidth ?? 0,
374381
onChanged: (value) {
375382
setState(() {
376383
borderWidth = value;
@@ -380,7 +387,7 @@ class __PageState extends State<_Page> {
380387
),
381388
Padding(
382389
padding: EdgeInsets.only(right: 12),
383-
child: Text(borderWidth.floor().toString()),
390+
child: Text((borderWidth ?? 0).floor().toString()),
384391
),
385392
],
386393
);
@@ -516,25 +523,28 @@ class __PageState extends State<_Page> {
516523
final Color buttonInnactiveColor = Colors.white;
517524

518525
final Color iconActiveColor = Colors.white;
519-
final Color iconInactiveColor = Colors.black.withOpacity(0.3);
526+
final Color iconInactiveColor = Colors.black.withValues(alpha: 0.3);
520527

521528
return Row(
522529
mainAxisSize: MainAxisSize.max,
523530
children: <Widget>[
524531
Expanded(
525532
child: Padding(
526533
padding: const EdgeInsets.all(8.0),
527-
child: RaisedButton(
528-
shape: RoundedRectangleBorder(
529-
borderRadius: BorderRadius.circular(12)),
534+
child: ElevatedButton(
535+
style: ElevatedButton.styleFrom(
536+
shape: RoundedRectangleBorder(
537+
borderRadius: BorderRadius.circular(12),
538+
),
539+
backgroundColor: shape == NeumorphicShape.concave
540+
? buttonActiveColor
541+
: buttonInnactiveColor,
542+
),
530543
onPressed: () {
531544
setState(() {
532545
shape = NeumorphicShape.concave;
533546
});
534547
},
535-
color: shape == NeumorphicShape.concave
536-
? buttonActiveColor
537-
: buttonInnactiveColor,
538548
child: Image.asset("assets/images/concave.png",
539549
color: shape == NeumorphicShape.concave
540550
? iconActiveColor
@@ -545,17 +555,20 @@ class __PageState extends State<_Page> {
545555
Expanded(
546556
child: Padding(
547557
padding: const EdgeInsets.all(8.0),
548-
child: RaisedButton(
549-
shape: RoundedRectangleBorder(
550-
borderRadius: BorderRadius.circular(12)),
558+
child: ElevatedButton(
559+
style: ElevatedButton.styleFrom(
560+
shape: RoundedRectangleBorder(
561+
borderRadius: BorderRadius.circular(12),
562+
),
563+
backgroundColor: shape == NeumorphicShape.convex
564+
? buttonActiveColor
565+
: buttonInnactiveColor,
566+
),
551567
onPressed: () {
552568
setState(() {
553569
shape = NeumorphicShape.convex;
554570
});
555571
},
556-
color: shape == NeumorphicShape.convex
557-
? buttonActiveColor
558-
: buttonInnactiveColor,
559572
child: Image.asset("assets/images/convex.png",
560573
color: shape == NeumorphicShape.convex
561574
? iconActiveColor
@@ -566,17 +579,20 @@ class __PageState extends State<_Page> {
566579
Expanded(
567580
child: Padding(
568581
padding: const EdgeInsets.all(8.0),
569-
child: RaisedButton(
570-
shape: RoundedRectangleBorder(
571-
borderRadius: BorderRadius.circular(12)),
582+
child: ElevatedButton(
583+
style: ElevatedButton.styleFrom(
584+
shape: RoundedRectangleBorder(
585+
borderRadius: BorderRadius.circular(12),
586+
),
587+
backgroundColor: shape == NeumorphicShape.flat
588+
? buttonActiveColor
589+
: buttonInnactiveColor,
590+
),
572591
onPressed: () {
573592
setState(() {
574593
shape = NeumorphicShape.flat;
575594
});
576595
},
577-
color: shape == NeumorphicShape.flat
578-
? buttonActiveColor
579-
: buttonInnactiveColor,
580596
child: Image.asset("assets/images/flat.png",
581597
color: shape == NeumorphicShape.flat
582598
? iconActiveColor

0 commit comments

Comments
 (0)