fix loader in login
parent
748802af1d
commit
1f2aebde33
Binary file not shown.
|
After Width: | Height: | Size: 140 KiB |
@ -0,0 +1,43 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_gifimage/flutter_gifimage.dart';
|
||||
|
||||
class GifLoaderContainer extends StatefulWidget {
|
||||
@override
|
||||
_GifLoaderContainerState createState() => _GifLoaderContainerState();
|
||||
}
|
||||
|
||||
class _GifLoaderContainerState extends State<GifLoaderContainer>
|
||||
with TickerProviderStateMixin {
|
||||
GifController controller1;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
controller1 = GifController(vsync: this);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
controller1.repeat(
|
||||
min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller1.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
//progress-loading.gif
|
||||
child: Container(
|
||||
// margin: EdgeInsets.only(bottom: 40),
|
||||
child: GifImage(
|
||||
controller: controller1,
|
||||
image: AssetImage(
|
||||
"assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'gif_loader_container.dart';
|
||||
|
||||
|
||||
class GifLoaderDialogUtils {
|
||||
static showMyDialog(BuildContext context) {
|
||||
showDialog(context: context, child: GifLoaderContainer());
|
||||
}
|
||||
|
||||
static hideDialog(BuildContext context) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue