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:
@@ -52,7 +52,7 @@ class CategoriesPage extends StatelessWidget {
|
||||
key: Key(categories.toString()),
|
||||
child: Column(
|
||||
children: [
|
||||
FilledTabBar(
|
||||
AppTabBar(
|
||||
key: PageStorageKey(categories.toString()),
|
||||
tabs: categories.map((e) {
|
||||
String title = e;
|
||||
|
@@ -2000,6 +2000,7 @@ class _ComicPageLoadingPlaceHolder extends StatelessWidget {
|
||||
}
|
||||
|
||||
return Shimmer(
|
||||
color: context.isDarkMode ? Colors.grey.shade700 : Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
Appbar(title: Text(""), backgroundColor: context.colorScheme.surface),
|
||||
|
@@ -73,6 +73,7 @@ class _CommentsPageState extends State<CommentsPage> {
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: Appbar(
|
||||
title: Text("Comments".tl),
|
||||
style: AppbarStyle.shadow,
|
||||
),
|
||||
body: buildBody(context),
|
||||
);
|
||||
|
@@ -137,7 +137,7 @@ class _ExplorePageState extends State<ExplorePage>
|
||||
}
|
||||
|
||||
Widget tabBar = Material(
|
||||
child: FilledTabBar(
|
||||
child: AppTabBar(
|
||||
key: PageStorageKey(pages.toString()),
|
||||
tabs: pages.map((e) => buildTab(e)).toList(),
|
||||
controller: controller,
|
||||
|
@@ -391,7 +391,7 @@ class _ImageFavoritesDialogState extends State<_ImageFavoritesDialog> {
|
||||
Widget build(BuildContext context) {
|
||||
Widget tabBar = Material(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: FilledTabBar(
|
||||
child: AppTabBar(
|
||||
key: PageStorageKey(optionTypes),
|
||||
tabs: optionTypes.map((e) => Tab(text: e.tl, key: Key(e))).toList(),
|
||||
),
|
||||
|
@@ -170,7 +170,39 @@ class _SettingsPageState extends State<SettingsPage> implements PopEntry {
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(child: buildRight())
|
||||
Expanded(
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
transitionBuilder: (child, animation) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, constrains) {
|
||||
return AnimatedBuilder(
|
||||
animation: animation,
|
||||
builder: (context, _) {
|
||||
var width = constrains.maxWidth;
|
||||
var value = animation.isForwardOrCompleted
|
||||
? 1 - animation.value
|
||||
: 1;
|
||||
var left = width * value;
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
left: left,
|
||||
width: width,
|
||||
child: child,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
child: buildRight(),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
} else {
|
||||
@@ -179,14 +211,13 @@ class _SettingsPageState extends State<SettingsPage> implements PopEntry {
|
||||
Positioned.fill(child: buildLeft()),
|
||||
Positioned(
|
||||
left: offset,
|
||||
right: 0,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
child: Listener(
|
||||
onPointerDown: handlePointerDown,
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
reverseDuration: const Duration(milliseconds: 300),
|
||||
duration: const Duration(milliseconds: 200),
|
||||
switchInCurve: Curves.fastOutSlowIn,
|
||||
switchOutCurve: Curves.fastOutSlowIn,
|
||||
transitionBuilder: (child, animation) {
|
||||
@@ -198,11 +229,7 @@ class _SettingsPageState extends State<SettingsPage> implements PopEntry {
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
child: currentPage == -1
|
||||
? const SizedBox(
|
||||
key: Key("1"),
|
||||
)
|
||||
: buildRight(),
|
||||
child: buildRight(),
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -307,7 +334,7 @@ class _SettingsPageState extends State<SettingsPage> implements PopEntry {
|
||||
}
|
||||
|
||||
Widget buildRight() {
|
||||
final Widget body = switch (currentPage) {
|
||||
return switch (currentPage) {
|
||||
-1 => const SizedBox(),
|
||||
0 => const ExploreSettings(),
|
||||
1 => const ReaderSettings(),
|
||||
@@ -318,10 +345,6 @@ class _SettingsPageState extends State<SettingsPage> implements PopEntry {
|
||||
6 => const AboutSettings(),
|
||||
_ => throw UnimplementedError()
|
||||
};
|
||||
|
||||
return Material(
|
||||
child: body,
|
||||
);
|
||||
}
|
||||
|
||||
var canPop = ValueNotifier(true);
|
||||
|
Reference in New Issue
Block a user