mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
improve performance & ui
This commit is contained in:
@@ -43,7 +43,7 @@ class ComicTile extends StatelessWidget {
|
||||
var renderBox = context.findRenderObject() as RenderBox;
|
||||
var size = renderBox.size;
|
||||
var location = renderBox.localToGlobal(
|
||||
Offset(size.width / 2, size.height / 2),
|
||||
Offset((size.width - 242) / 2, size.height / 2),
|
||||
);
|
||||
showMenu(location, context);
|
||||
}
|
||||
|
@@ -96,6 +96,20 @@ class ListLoadingIndicator extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class SliverListLoadingIndicator extends StatelessWidget {
|
||||
const SliverListLoadingIndicator({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// SliverToBoxAdapter can not been lazy loaded.
|
||||
// Use SliverList to make sure the animation can be lazy loaded.
|
||||
return SliverList.list(children: const [
|
||||
SizedBox(),
|
||||
ListLoadingIndicator(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class LoadingState<T extends StatefulWidget, S extends Object>
|
||||
extends State<T> {
|
||||
bool isLoading = false;
|
||||
@@ -299,9 +313,7 @@ abstract class MultiPageLoadingState<T extends StatefulWidget, S extends Object>
|
||||
|
||||
Widget buildLoading(BuildContext context) {
|
||||
return Center(
|
||||
child: const CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
).fixWidth(32).fixHeight(32),
|
||||
child: const CircularProgressIndicator().fixWidth(32).fixHeight(32),
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -42,6 +42,9 @@ class _MenuRoute<T> extends PopupRoute<T> {
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: context.brightness == Brightness.dark
|
||||
? Border.all(color: context.colorScheme.outlineVariant)
|
||||
: null,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: context.colorScheme.shadow.withOpacity(0.2),
|
||||
@@ -51,10 +54,10 @@ class _MenuRoute<T> extends PopupRoute<T> {
|
||||
],
|
||||
),
|
||||
child: BlurEffect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
child: Material(
|
||||
color: context.colorScheme.surface.withOpacity(0.82),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
color: context.colorScheme.surface.withOpacity(0.78),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
child: Container(
|
||||
width: width,
|
||||
padding:
|
||||
|
Reference in New Issue
Block a user