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

Hook 1.5.4 Cupertino #291

Merged
merged 6 commits into from
Aug 27, 2019
Merged
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
1,042 changes: 1,042 additions & 0 deletions Runtime/cupertino/action_sheet.cs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions Runtime/cupertino/action_sheet.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions Runtime/cupertino/app.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ public CupertinoApp(
List<Locale> supportedLocales = null,
bool showPerformanceOverlay = false
) : base(key: key) {
// D.assert(routes != null);
// D.assert(navigatorObservers != null);
// D.assert(title != null);
// D.assert(showPerformanceOverlay != null);
D.assert(title != null);

supportedLocales = supportedLocales ?? new List<Locale> {new Locale("en", "US")};
this.navigatorKey = navigatorKey;
Expand Down Expand Up @@ -124,7 +121,13 @@ void _updateNavigator() {
this._navigatorObservers = new List<NavigatorObserver>();
}
}


// Iterable<LocalizationsDelegate<dynamic>> get _localizationsDelegates sync* {
// if (widget.localizationsDelegates != null)
// yield* widget.localizationsDelegates;
// yield DefaultCupertinoLocalizations.delegate;
// }

List<LocalizationsDelegate> _localizationsDelegates {
get {
List<LocalizationsDelegate<CupertinoLocalizations>> _delegates =
Expand Down
6 changes: 4 additions & 2 deletions Runtime/cupertino/bottom_app_bar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public CupertinoTabBar(
() => "Tabs need at least 2 items to conform to Apple's HIG"
);
D.assert(0 <= currentIndex && currentIndex < items.Count);
D.assert(inactiveColor != null);


this.items = items;
this.onTap = onTap;
this.currentIndex = currentIndex;
Expand Down Expand Up @@ -122,13 +123,14 @@ List<Widget> _buildTabItems(BuildContext context) {

for (int index = 0; index < this.items.Count; index += 1) {
bool active = index == this.currentIndex;
var tabIndex = index;
result.Add(
this._wrapActiveItem(
context,
new Expanded(
child: new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: this.onTap == null ? null : (GestureTapCallback) (() => { this.onTap(index); }),
onTap: this.onTap == null ? null : (GestureTapCallback) (() => { this.onTap(tabIndex); }),
child: new Padding(
padding: EdgeInsets.only(bottom: 4.0f),
child: new Column(
Expand Down
14 changes: 6 additions & 8 deletions Runtime/cupertino/button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public CupertinoButton(
BorderRadius borderRadius = null,
bool filled = false
) : base(key: key) {
D.assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0));
D.assert(pressedOpacity >= 0.0 && pressedOpacity <= 1.0);
this._filled = filled;
this.child = child;
this.onPressed = onPressed;
Expand All @@ -53,7 +53,7 @@ public static CupertinoButton filled(
float pressedOpacity = 0.1f,
BorderRadius borderRadius = null
) {
D.assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0));
D.assert(pressedOpacity >= 0.0 && pressedOpacity <= 1.0);
return new CupertinoButton(
key: key,
color: null,
Expand Down Expand Up @@ -202,12 +202,10 @@ public override Widget build(BuildContext context) {
}
},
child: new ConstrainedBox(
constraints: this.widget.minSize == null
? new BoxConstraints()
: new BoxConstraints(
minWidth: this.widget.minSize,
minHeight: this.widget.minSize
),
constraints: new BoxConstraints(
minWidth: this.widget.minSize,
minHeight: this.widget.minSize
),
child: new FadeTransition(
opacity: this._opacityAnimation,
child: new DecoratedBox(
Expand Down
Loading