mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
improve ui
This commit is contained in:
@@ -73,8 +73,12 @@ class _AppbarState extends State<Appbar> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var content = SizedBox(
|
||||
height: _kAppBarHeight,
|
||||
var content = Container(
|
||||
decoration: BoxDecoration(
|
||||
color: widget.backgroundColor ??
|
||||
context.colorScheme.surface.withOpacity(0.72),
|
||||
),
|
||||
height: _kAppBarHeight + context.padding.top,
|
||||
child: Row(
|
||||
children: [
|
||||
const SizedBox(width: 8),
|
||||
@@ -102,17 +106,12 @@ class _AppbarState extends State<Appbar> {
|
||||
width: 8,
|
||||
)
|
||||
],
|
||||
),
|
||||
).paddingTop(context.padding.top);
|
||||
if (widget.backgroundColor != Colors.transparent) {
|
||||
return Material(
|
||||
elevation: (_scrolledUnder && context.width < changePoint) ? 1 : 0,
|
||||
surfaceTintColor: Theme.of(context).colorScheme.surfaceTint,
|
||||
color: widget.backgroundColor ?? Theme.of(context).colorScheme.surface,
|
||||
child: content,
|
||||
);
|
||||
}
|
||||
return content;
|
||||
).paddingTop(context.padding.top),
|
||||
);
|
||||
return BlurEffect(
|
||||
blur: _scrolledUnder ? 15 : 0,
|
||||
child: content,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +191,7 @@ class _MySliverAppBarDelegate extends SliverPersistentHeaderDelegate {
|
||||
)
|
||||
: const SizedBox()),
|
||||
const SizedBox(
|
||||
width: 24,
|
||||
width: 16,
|
||||
),
|
||||
Expanded(
|
||||
child: DefaultTextStyle(
|
||||
|
@@ -735,6 +735,12 @@ class ComicListState extends State<ComicList> {
|
||||
}
|
||||
|
||||
Future<void> _loadPage(int page) async {
|
||||
if (widget.loadPage == null && widget.loadNext == null) {
|
||||
_error = "loadPage and loadNext can't be null at the same time";
|
||||
Future.microtask(() {
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
if (_loading[page] == true) {
|
||||
return;
|
||||
}
|
||||
@@ -790,9 +796,6 @@ class ComicListState extends State<ComicList> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.loadPage == null && widget.loadNext == null) {
|
||||
throw Exception("loadPage and loadNext can't be null at the same time");
|
||||
}
|
||||
if (_error != null) {
|
||||
return Column(
|
||||
children: [
|
||||
@@ -814,19 +817,27 @@ class ComicListState extends State<ComicList> {
|
||||
}
|
||||
if (_data[_page] == null) {
|
||||
_loadPage(_page);
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
return Column(
|
||||
children: [
|
||||
if (widget.errorLeading != null) widget.errorLeading!,
|
||||
const Expanded(
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
return SmoothCustomScrollView(
|
||||
slivers: [
|
||||
if (widget.leadingSliver != null) widget.leadingSliver!,
|
||||
_buildSliverPageSelector(),
|
||||
if (_maxPage != 1) _buildSliverPageSelector(),
|
||||
SliverGridComics(
|
||||
comics: _data[_page] ?? const [],
|
||||
menuBuilder: widget.menuBuilder,
|
||||
),
|
||||
if (_data[_page]!.length > 6) _buildSliverPageSelector(),
|
||||
if (_data[_page]!.length > 6 && _maxPage != 1)
|
||||
_buildSliverPageSelector(),
|
||||
if (widget.trailingSliver != null) widget.trailingSliver!,
|
||||
],
|
||||
);
|
||||
|
@@ -148,7 +148,7 @@ class _NaviPaneState extends State<NaviPane>
|
||||
return _NaviPopScope(
|
||||
action: () {
|
||||
if (App.mainNavigatorKey!.currentState!.canPop()) {
|
||||
App.mainNavigatorKey!.currentState!.pop();
|
||||
App.mainNavigatorKey!.currentState!.maybePop();
|
||||
} else {
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
@@ -627,16 +627,9 @@ class _NaviPopScope extends StatelessWidget {
|
||||
? child
|
||||
: PopScope(
|
||||
canPop: App.isAndroid ? false : true,
|
||||
// flutter <3.24.0 api
|
||||
onPopInvoked: (value) {
|
||||
action();
|
||||
},
|
||||
/*
|
||||
flutter >=3.24.0 api
|
||||
onPopInvokedWithResult: (value, result) {
|
||||
action();
|
||||
},
|
||||
*/
|
||||
child: child,
|
||||
);
|
||||
if (popGesture) {
|
||||
|
Reference in New Issue
Block a user