55 lines
1.1 KiB
Dart
55 lines
1.1 KiB
Dart
import 'dart:async';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
|
|
|
class Empty extends StatefulWidget {
|
|
Empty({super.key});
|
|
|
|
@override
|
|
State<Empty> createState() => _EmptyState();
|
|
}
|
|
|
|
class _EmptyState extends State<Empty> {
|
|
String empty = "";
|
|
bool closepage = false;
|
|
|
|
@override
|
|
void initState() {
|
|
// TODO: implement initState
|
|
super.initState();
|
|
Timer(const Duration(milliseconds: 1200), () {
|
|
if (empty.isEmpty && closepage == false) {
|
|
setState(() {
|
|
empty = "assets/images/new_empty.png";
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
// TODO: implement dispose
|
|
super.dispose();
|
|
closepage = true;
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (empty.isEmpty) {
|
|
return Container();
|
|
} else {
|
|
return Container(
|
|
width: double.infinity,
|
|
margin: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.3),
|
|
alignment: Alignment.center,
|
|
child: Container(
|
|
width: 164.rpx,
|
|
height: 230.rpx,
|
|
child: Image.asset(empty),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
}
|