提交 a33c9b33 authored 作者: shixiaochen's avatar shixiaochen

1、修改 StateLayout

上级 272dee82
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../utils/image_utils.dart';
class StateLayout extends StatefulWidget {
const StateLayout({Key? key, required this.type, this.hintText})
: super(key: key);
final StateType type;
final String? hintText;
@override
State<StateLayout> createState() => _StateLayoutState();
}
......@@ -16,14 +15,7 @@ class StateLayout extends StatefulWidget {
class _StateLayoutState extends State<StateLayout> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: SizedBox(
height: MediaQuery.of(context).size.height - 30.0,
child: widget.type == StateType.loading
? _loadingWidget()
: _otherWidget(),
),
);
return widget.type == StateType.loading ? _loadingWidget() : _otherWidget();
}
Widget _loadingWidget() {
......@@ -32,13 +24,6 @@ class _StateLayoutState extends State<StateLayout> {
mainAxisAlignment: MainAxisAlignment.center,
children: const [
CupertinoActivityIndicator(radius: 16.0),
SizedBox(
width: double.infinity,
height: 16.0,
),
SizedBox(
height: 50,
),
],
);
}
......@@ -63,28 +48,24 @@ class _StateLayoutState extends State<StateLayout> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Opacity(
opacity: 1,
child: Container(
height: 120.0,
width: 120.0,
decoration: BoxDecoration(
image: DecorationImage(
image: ImageUtils.getAssetImage(img),
),
),
)),
// Opacity(
// opacity: 1,
// child: Container(
// height: 120.0,
// width: 120.0,
// decoration: BoxDecoration(
// image: DecorationImage(
// image: ImageUtils.getAssetImage(img),
// ),
// ),
// )),
const SizedBox(
width: double.infinity,
height: 16.0,
),
Text(
hintText,
style: const TextStyle(fontSize: 14, color: Colors.grey),
),
const SizedBox(
height: 50,
),
],
);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论