NEW: MIH Loading revamp
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 41 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 41 KiB |
@@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import 'package:gif_view/gif_view.dart';
|
|
||||||
|
|
||||||
class Mihloadingcircle extends StatefulWidget {
|
class Mihloadingcircle extends StatefulWidget {
|
||||||
final String? message;
|
final String? message;
|
||||||
@@ -11,8 +11,11 @@ class Mihloadingcircle extends StatefulWidget {
|
|||||||
State<Mihloadingcircle> createState() => _MihloadingcircleState();
|
State<Mihloadingcircle> createState() => _MihloadingcircleState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MihloadingcircleState extends State<Mihloadingcircle> {
|
class _MihloadingcircleState extends State<Mihloadingcircle>
|
||||||
// final GifController _controller = GifController();
|
with SingleTickerProviderStateMixin {
|
||||||
|
late AnimationController _controller;
|
||||||
|
late Animation<double> _animation;
|
||||||
|
|
||||||
late double popUpPaddingSize;
|
late double popUpPaddingSize;
|
||||||
late double popUpWidth;
|
late double popUpWidth;
|
||||||
late double? popUpheight;
|
late double? popUpheight;
|
||||||
@@ -38,14 +41,26 @@ class _MihloadingcircleState extends State<Mihloadingcircle> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
//_controller.animateTo(26);
|
|
||||||
super.initState();
|
super.initState();
|
||||||
checkScreenSize();
|
checkScreenSize();
|
||||||
|
_controller = AnimationController(
|
||||||
|
duration: const Duration(
|
||||||
|
milliseconds: 500), // Duration for one pulse (grow and shrink)
|
||||||
|
vsync: this,
|
||||||
|
);
|
||||||
|
_animation = Tween<double>(
|
||||||
|
begin: 200,
|
||||||
|
end: 200 * 0.5, // Pulse to 50% of the initial size
|
||||||
|
).animate(CurvedAnimation(
|
||||||
|
parent: _controller,
|
||||||
|
curve: Curves.easeInOut, // Smooth start and end of the pulse
|
||||||
|
));
|
||||||
|
_controller.repeat(reverse: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
// _controller.dispose();
|
_controller.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,13 +85,22 @@ class _MihloadingcircleState extends State<Mihloadingcircle> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
GifView.asset(
|
SizedBox(
|
||||||
MzansiInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.loadingImageLocation(),
|
|
||||||
height: 200,
|
|
||||||
width: 200,
|
width: 200,
|
||||||
frameRate: 30,
|
height: 200,
|
||||||
|
child: AnimatedBuilder(
|
||||||
|
animation: _animation,
|
||||||
|
builder: (context, child) {
|
||||||
|
return Icon(
|
||||||
|
MihIcons.mihLogo,
|
||||||
|
size: _animation
|
||||||
|
.value, // The size changes based on the animation value
|
||||||
|
color: MihColors.getSecondaryColor(
|
||||||
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
|
"Dark"),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
widget.message != null
|
widget.message != null
|
||||||
? Text(
|
? Text(
|
||||||
|
|||||||
Reference in New Issue
Block a user