Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit b34825e

Browse files
authored
Merge pull request #291 from IIzzaya/hook1.5.4
Hook 1.5.4 Cupertino
2 parents 2956a50 + 67bd18c commit b34825e

40 files changed

+3373
-143
lines changed

Runtime/cupertino/action_sheet.cs

Lines changed: 1042 additions & 0 deletions
Large diffs are not rendered by default.

Runtime/cupertino/action_sheet.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Runtime/cupertino/app.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ public CupertinoApp(
2727
List<Locale> supportedLocales = null,
2828
bool showPerformanceOverlay = false
2929
) : base(key: key) {
30-
// D.assert(routes != null);
31-
// D.assert(navigatorObservers != null);
32-
// D.assert(title != null);
33-
// D.assert(showPerformanceOverlay != null);
30+
D.assert(title != null);
3431

3532
supportedLocales = supportedLocales ?? new List<Locale> {new Locale("en", "US")};
3633
this.navigatorKey = navigatorKey;
@@ -124,7 +121,13 @@ void _updateNavigator() {
124121
this._navigatorObservers = new List<NavigatorObserver>();
125122
}
126123
}
127-
124+
125+
// Iterable<LocalizationsDelegate<dynamic>> get _localizationsDelegates sync* {
126+
// if (widget.localizationsDelegates != null)
127+
// yield* widget.localizationsDelegates;
128+
// yield DefaultCupertinoLocalizations.delegate;
129+
// }
130+
128131
List<LocalizationsDelegate> _localizationsDelegates {
129132
get {
130133
List<LocalizationsDelegate<CupertinoLocalizations>> _delegates =

Runtime/cupertino/bottom_app_bar.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public CupertinoTabBar(
3131
() => "Tabs need at least 2 items to conform to Apple's HIG"
3232
);
3333
D.assert(0 <= currentIndex && currentIndex < items.Count);
34-
D.assert(inactiveColor != null);
34+
35+
3536
this.items = items;
3637
this.onTap = onTap;
3738
this.currentIndex = currentIndex;
@@ -122,13 +123,14 @@ List<Widget> _buildTabItems(BuildContext context) {
122123

123124
for (int index = 0; index < this.items.Count; index += 1) {
124125
bool active = index == this.currentIndex;
126+
var tabIndex = index;
125127
result.Add(
126128
this._wrapActiveItem(
127129
context,
128130
new Expanded(
129131
child: new GestureDetector(
130132
behavior: HitTestBehavior.opaque,
131-
onTap: this.onTap == null ? null : (GestureTapCallback) (() => { this.onTap(index); }),
133+
onTap: this.onTap == null ? null : (GestureTapCallback) (() => { this.onTap(tabIndex); }),
132134
child: new Padding(
133135
padding: EdgeInsets.only(bottom: 4.0f),
134136
child: new Column(

Runtime/cupertino/button.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public CupertinoButton(
3131
BorderRadius borderRadius = null,
3232
bool filled = false
3333
) : base(key: key) {
34-
D.assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0));
34+
D.assert(pressedOpacity >= 0.0 && pressedOpacity <= 1.0);
3535
this._filled = filled;
3636
this.child = child;
3737
this.onPressed = onPressed;
@@ -53,7 +53,7 @@ public static CupertinoButton filled(
5353
float pressedOpacity = 0.1f,
5454
BorderRadius borderRadius = null
5555
) {
56-
D.assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0));
56+
D.assert(pressedOpacity >= 0.0 && pressedOpacity <= 1.0);
5757
return new CupertinoButton(
5858
key: key,
5959
color: null,
@@ -202,12 +202,10 @@ public override Widget build(BuildContext context) {
202202
}
203203
},
204204
child: new ConstrainedBox(
205-
constraints: this.widget.minSize == null
206-
? new BoxConstraints()
207-
: new BoxConstraints(
208-
minWidth: this.widget.minSize,
209-
minHeight: this.widget.minSize
210-
),
205+
constraints: new BoxConstraints(
206+
minWidth: this.widget.minSize,
207+
minHeight: this.widget.minSize
208+
),
211209
child: new FadeTransition(
212210
opacity: this._opacityAnimation,
213211
child: new DecoratedBox(

0 commit comments

Comments
 (0)