63 lines
1.3 KiB
Dart
63 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../common/app_colors.dart';
|
|
import '../common/assets.dart';
|
|
|
|
class SplashPage extends StatelessWidget {
|
|
const SplashPage({Key? key}) : super(key: key);
|
|
|
|
//logo
|
|
Widget _buildLogo() {
|
|
return Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
//底部白色背景
|
|
Container(
|
|
// color: Colors.white,
|
|
width: 120,
|
|
height: 120,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(48),
|
|
),
|
|
),
|
|
|
|
//上层图片
|
|
Image.asset(
|
|
AssetsImages.logopang,
|
|
width: 84,
|
|
height: 80,
|
|
)
|
|
],
|
|
);
|
|
}
|
|
|
|
//主视图 拆成函数
|
|
Widget _buildView(BuildContext context) {
|
|
return Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
//logo
|
|
_buildLogo(),
|
|
|
|
//标题
|
|
const Text('Online Market'),
|
|
|
|
//计数器
|
|
const Text('10'),
|
|
|
|
//end
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: _buildView(context),
|
|
backgroundColor: AppColors.backgroundSplash,
|
|
);
|
|
}
|
|
}
|