Commit 366f13c2 by tanghuan

加载提示页

1 parent 9e6c2cc5
......@@ -61,16 +61,7 @@ class WebPage extends StatelessWidget {
children: [
state.loaded
? WebViewWidget(controller: ctx.read<WebCubit>().controller)
: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircularProgressIndicator(color: Color(0xFF7691fa)),
SizedBox(height: 16),
Text('加载中...'),
],
),
),
: _buildLoadingView(ctx),
// 添加升级遮罩层
if (state.isUpgrading)
Container(
......@@ -182,6 +173,70 @@ class WebPage extends StatelessWidget {
);
}
Widget _buildLoadingView(
BuildContext context, {
String message = '加载中...',
Color textColor = const Color(0xFF333333),
}) {
final screenWidth = MediaQuery.sizeOf(context).width;
// 设计稿尺寸:356dp × 564dp
const designWidth = 356.0;
const designHeight = 564.0;
final scale = screenWidth / designWidth;
final heightScale = MediaQuery.sizeOf(context).height / designHeight;
final sloganWidth = 230.0 * scale;
final brandWidth = 170.0 * scale;
final sloganTopPadding = 140.0 * scale;
final loadingSpacing = 60.0 * heightScale;
final brandBottomPadding = 40.0 * heightScale;
return SizedBox.expand(
child: Column(
children: [
Padding(
padding: EdgeInsets.only(top: sloganTopPadding),
child: Image.asset(
'assets/images/login_v3/index_slogan.png',
width: sloganWidth,
),
),
SizedBox(height: loadingSpacing),
Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(
color: Color(0xFF7691fa),
strokeWidth: 3,
),
),
const SizedBox(height: 16),
Text(
message,
style: TextStyle(
fontSize: 14,
color: textColor,
height: null,
fontWeight: FontWeight.normal,
),
),
],
),
const Spacer(),
Padding(
padding: EdgeInsets.only(bottom: brandBottomPadding),
child: Image.asset(
'assets/images/login_v3/index_brand.png',
width: brandWidth,
),
),
],
),
);
}
AppBar _buildAppBar(BuildContext ctx, WebState state) {
return AppBar(
title: EnvConfig.isDev()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!