98 lines
3.0 KiB
Dart
98 lines
3.0 KiB
Dart
import 'package:flutter/material.dart';
|
||
import 'camera_screen.dart';
|
||
|
||
class WelcomeScreen extends StatelessWidget {
|
||
const WelcomeScreen({super.key});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Scaffold(
|
||
body: Container(
|
||
decoration: BoxDecoration(
|
||
gradient: LinearGradient(
|
||
begin: Alignment.topCenter,
|
||
end: Alignment.bottomCenter,
|
||
colors: [
|
||
Colors.blue.shade400,
|
||
Colors.blue.shade700,
|
||
],
|
||
),
|
||
),
|
||
child: SafeArea(
|
||
child: Center(
|
||
child: Column(
|
||
mainAxisAlignment: MainAxisAlignment.center,
|
||
children: [
|
||
// 图标
|
||
Icon(
|
||
Icons.camera_alt,
|
||
size: 100,
|
||
color: Colors.white,
|
||
),
|
||
const SizedBox(height: 30),
|
||
|
||
// 标题
|
||
const Text(
|
||
'自动拍照应用',
|
||
style: TextStyle(
|
||
fontSize: 32,
|
||
fontWeight: FontWeight.bold,
|
||
color: Colors.white,
|
||
),
|
||
),
|
||
const SizedBox(height: 20),
|
||
|
||
// 说明文字
|
||
Padding(
|
||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||
child: Text(
|
||
'点击按钮开始自动拍照\n每2秒拍摄一次,共拍摄5张照片',
|
||
textAlign: TextAlign.center,
|
||
style: TextStyle(
|
||
fontSize: 16,
|
||
color: Colors.white.withOpacity(0.9),
|
||
height: 1.5,
|
||
),
|
||
),
|
||
),
|
||
const SizedBox(height: 60),
|
||
|
||
// 开始按钮
|
||
ElevatedButton(
|
||
onPressed: () {
|
||
Navigator.push(
|
||
context,
|
||
MaterialPageRoute(
|
||
builder: (context) => const CameraScreen(),
|
||
),
|
||
);
|
||
},
|
||
style: ElevatedButton.styleFrom(
|
||
backgroundColor: Colors.white,
|
||
foregroundColor: Colors.blue.shade700,
|
||
padding: const EdgeInsets.symmetric(
|
||
horizontal: 50,
|
||
vertical: 18,
|
||
),
|
||
shape: RoundedRectangleBorder(
|
||
borderRadius: BorderRadius.circular(30),
|
||
),
|
||
elevation: 5,
|
||
),
|
||
child: const Text(
|
||
'开始拍照',
|
||
style: TextStyle(
|
||
fontSize: 20,
|
||
fontWeight: FontWeight.bold,
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
),
|
||
);
|
||
}
|
||
}
|