棉花app新增页面
This commit is contained in:
54
lib/pages/device_control/Empty.dart
Normal file
54
lib/pages/device_control/Empty.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
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),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user