Skip to content

Commit

Permalink
Fix layout issue with null appBar in NavigationView
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-hann committed Oct 6, 2021
1 parent 5a8aacd commit fa2fc4a
Show file tree
Hide file tree
Showing 5 changed files with 4,510 additions and 2,255 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Date format: DD/MM/YYYY
## [3.x.x] - Flutter 2.5.0 - [DD/MM/YYYY]

- Added builder variant to `NavigationBody`.
- Fixed content bug when `AppBar` was not supplied too `NavigationView`

## [3.2.0] - Flutter 2.5.0 - [15/09/2021]

Expand Down
31 changes: 23 additions & 8 deletions example/lib/screens/typography.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,36 @@ class _TypographyPageState extends State<TypographyPage> {
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
children: [
Text('Display', style: typography.display?.apply(fontSizeFactor: scale)),
Text('Display',
style:
typography.display?.apply(fontSizeFactor: scale)),
spacer,
Text('Title Large', style: typography.titleLarge?.apply(fontSizeFactor: scale)),
Text('Title Large',
style: typography.titleLarge
?.apply(fontSizeFactor: scale)),
spacer,
Text('Title', style: typography.title?.apply(fontSizeFactor: scale)),
Text('Title',
style:
typography.title?.apply(fontSizeFactor: scale)),
spacer,
Text('Subtitle', style: typography.subtitle?.apply(fontSizeFactor: scale)),
Text('Subtitle',
style: typography.subtitle
?.apply(fontSizeFactor: scale)),
spacer,
Text('Body Large', style: typography.bodyLarge?.apply(fontSizeFactor: scale)),
Text('Body Large',
style: typography.bodyLarge
?.apply(fontSizeFactor: scale)),
spacer,
Text('Body Strong', style: typography.bodyStrong?.apply(fontSizeFactor: scale)),
Text('Body Strong',
style: typography.bodyStrong
?.apply(fontSizeFactor: scale)),
spacer,
Text('Body', style: typography.body?.apply(fontSizeFactor: scale)),
Text('Body',
style: typography.body?.apply(fontSizeFactor: scale)),
spacer,
Text('Caption', style: typography.caption?.apply(fontSizeFactor: scale)),
Text('Caption',
style:
typography.caption?.apply(fontSizeFactor: scale)),
spacer,
],
),
Expand Down
5 changes: 4 additions & 1 deletion lib/src/controls/navigation/navigation_view/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ class NavigationViewState extends State<NavigationView> {
: null,
);
}
return const SizedBox.shrink();
return LayoutBuilder(
builder: (context, constraints) =>
SizedBox(width: constraints.maxWidth, height: 0),
);
}();

Widget paneResult = LayoutBuilder(
Expand Down
20 changes: 10 additions & 10 deletions lib/src/controls/utils/scrollbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ class _ScrollbarState extends RawScrollbarState<Scrollbar> {
super.handleThumbPressStart(localPosition);
if (mounted) {
setState(() {
_dragIsActive = true;
});
_dragIsActive = true;
});
}
}

Expand All @@ -139,8 +139,8 @@ class _ScrollbarState extends RawScrollbarState<Scrollbar> {
super.handleThumbPressEnd(localPosition, velocity);
if (mounted) {
setState(() {
_dragIsActive = false;
});
_dragIsActive = false;
});
}
}

Expand All @@ -152,17 +152,17 @@ class _ScrollbarState extends RawScrollbarState<Scrollbar> {
// Pointer is hovering over the scrollbar
if (mounted) {
setState(() {
_hoverIsActive = true;
});
_hoverIsActive = true;
});
}
_hoverController.forward();
} else if (_hoverIsActive) {
await _hoverController.reverse();
// Pointer was, but is no longer over painted scrollbar.
if (mounted) {
setState(() {
_hoverIsActive = false;
});
_hoverIsActive = false;
});
}
}
}
Expand All @@ -172,8 +172,8 @@ class _ScrollbarState extends RawScrollbarState<Scrollbar> {
super.handleHoverExit(event);
if (mounted) {
setState(() {
_hoverIsActive = false;
});
_hoverIsActive = false;
});
}
_hoverController.reverse();
}
Expand Down
Loading

0 comments on commit fa2fc4a

Please sign in to comment.