dynamic pop up - loading
This commit is contained in:
@@ -12,6 +12,28 @@ class Mihloadingcircle extends StatefulWidget {
|
|||||||
class _MihloadingcircleState extends State<Mihloadingcircle>
|
class _MihloadingcircleState extends State<Mihloadingcircle>
|
||||||
with TickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
late final GifController _controller;
|
late final GifController _controller;
|
||||||
|
late double popUpPaddingSize;
|
||||||
|
late double popUpWidth;
|
||||||
|
late double? popUpheight;
|
||||||
|
|
||||||
|
late double width;
|
||||||
|
late double height;
|
||||||
|
|
||||||
|
void checkScreenSize() {
|
||||||
|
if (MzanziInnovationHub.of(context)!.theme.screenType == "desktop") {
|
||||||
|
setState(() {
|
||||||
|
popUpWidth = 250;
|
||||||
|
popUpheight = 250;
|
||||||
|
popUpPaddingSize = 25.0;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
popUpWidth = 250;
|
||||||
|
popUpheight = 250;
|
||||||
|
popUpPaddingSize = 15.0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -30,10 +52,16 @@ class _MihloadingcircleState extends State<Mihloadingcircle>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
ImageProvider loading =
|
ImageProvider loading =
|
||||||
MzanziInnovationHub.of(context)!.theme.loadingImage();
|
MzanziInnovationHub.of(context)!.theme.loadingImage();
|
||||||
|
var size = MediaQuery.of(context).size;
|
||||||
|
setState(() {
|
||||||
|
width = size.width;
|
||||||
|
height = size.height;
|
||||||
|
});
|
||||||
|
checkScreenSize();
|
||||||
return Dialog(
|
return Dialog(
|
||||||
//backgroundColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
//backgroundColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: EdgeInsets.all(popUpPaddingSize),
|
||||||
width: 250,
|
width: 250,
|
||||||
height: 250,
|
height: 250,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|||||||
Reference in New Issue
Block a user