[Flutter] 쇼핑몰 6
2021. 1. 1. 08:46ㆍFlutter Mobile App/Flutter 쇼핑몰 앱
반응형
앱 뼈대 구성하기
- 스플래쉬 페이지 구성
lib\
screens\splash\splash_page.dart
더보기
import 'package:flutter/material.dart';
class SplashPage extends StatefulWidget {
SplashPage({Key key}) : super(key: key);
static const routeName = '/';
@override
_SplashPageState createState() => _SplashPageState();
}
String _msg = '';
class _SplashPageState extends State<SplashPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
color: Theme.of(context).primaryColor,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
SizedBox(),
Text(
'BOOKS PROJECT',
style: Theme.of(context).textTheme.headline6.copyWith(
color: Colors.white
),
),
Text(
'$_msg',
style: Theme.of(context).textTheme.bodyText1.copyWith(
color: Colors.white
),
),
Text(
'COPYRIGHT BOOKS PROJECT',
style: Theme.of(context).textTheme.caption.copyWith(
color: Colors.white
),
),
],
),
),
),
);
}
}
main.dart
더보기
import 'package:books/screens/splash/splash_page.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
// home: HomePage(),
home: SplashPage(),
);
}
}
// class HomePage extends StatefulWidget {
// @override
// _HomePageState createState() => _HomePageState();
// }
// class _HomePageState extends State<HomePage> {
// @override
// Widget build(BuildContext context) {
// return Container(
// );
// }
// }
반응형
'Flutter Mobile App > Flutter 쇼핑몰 앱' 카테고리의 다른 글
[Flutter] 쇼핑몰 7 (0) | 2021.01.01 |
---|---|
[Flutter] 쇼핑몰 5 (0) | 2021.01.01 |
[Flutter] 쇼핑몰 4 (0) | 2020.12.31 |
[Flutter] 쇼핑몰 4 (0) | 2020.12.31 |
[Flutter] 쇼핑몰 3 (0) | 2020.12.31 |