mirror of
https://github.com/zapstore/zapstore.git
synced 2026-10-05 20:48:24 +00:00
Add cool zs spinning logo
This commit is contained in:
@@ -16,6 +16,7 @@ import 'package:zapstore/screens/search_screen.dart';
|
||||
import 'package:zapstore/screens/settings_screen.dart';
|
||||
import 'package:zapstore/screens/updates_screen.dart';
|
||||
import 'package:zapstore/widgets/error_container.dart';
|
||||
import 'package:zapstore/widgets/spinning_logo.dart';
|
||||
|
||||
/// Application navigation.
|
||||
/// - Initializes Go Router, dispatches routes
|
||||
@@ -126,7 +127,7 @@ class ScaffoldWithNestedNavigation extends HookConsumerWidget {
|
||||
errorHandler(e, stack);
|
||||
return ErrorContainer(exception: e, stack: stack);
|
||||
},
|
||||
loading: () => const Center(child: CircularProgressIndicator()),
|
||||
loading: () => Center(child: SpinningLogo()),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SpinningLogo extends StatefulWidget {
|
||||
const SpinningLogo({super.key});
|
||||
|
||||
@override
|
||||
SpinningLogoState createState() => SpinningLogoState();
|
||||
}
|
||||
|
||||
class SpinningLogoState extends State<SpinningLogo>
|
||||
with TickerProviderStateMixin {
|
||||
late AnimationController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(
|
||||
vsync: this,
|
||||
duration: Duration(seconds: 2),
|
||||
)..repeat(); // Repeat the animation indefinitely
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose(); // Dispose of the controller when done
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: AnimatedBuilder(
|
||||
animation: _controller,
|
||||
builder: (context, child) {
|
||||
return Transform.rotate(
|
||||
angle:
|
||||
_controller.value * 2.0 * 3.14159, // Full rotation in radians
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
child: Image.asset(
|
||||
'assets/images/logo-fg.png',
|
||||
height: 200,
|
||||
width: 200,
|
||||
), // Adjust size as needed
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user