<< 소스 코드 >>
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Dice game',
home: LogIn(),
);
}
}
class LogIn extends StatefulWidget {
const LogIn({Key? key}) : super(key: key);
@override
State<LogIn> createState() => _LogInState();
}
class _LogInState extends State<LogIn> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Log in'),
backgroundColor: Colors.redAccent,
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: (){},
),
actions: <Widget>[
IconButton(onPressed: (){}, icon: Icon(Icons.search))
],
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Padding(padding: EdgeInsets.only(top: 50)),
Center(
child: Image(
image: AssetImage('assets/sanrio.png'),
width: 170.0,
height: 190.0,
),
),
Form(
child: Theme(
data: ThemeData(
primaryColor: Colors.teal,
inputDecorationTheme: InputDecorationTheme(
labelStyle: TextStyle(
color: Colors.teal,
fontSize: 15.0
)
)
),
child: Container(
padding: EdgeInsets.all(40.0),
child: Column(
children: [
TextField(
decoration: InputDecoration(
labelText: 'Enter "dice"'
),
keyboardType: TextInputType.emailAddress,
),
TextField(
decoration: InputDecoration(
labelText: 'Enter password'
),
keyboardType: TextInputType.text,
obscureText: true,
),
SizedBox(height: 40.0,),
ButtonTheme(
minWidth: 100.0,
height: 50.0,
child: ElevatedButton(
onPressed: (){},
child: Icon(
Icons.arrow_forward,
color: Colors.white,
size: 35.0,
))
),
],
)
)
),
),
],
),
),
);
}
}
<< 출력 화면 >>
'Flutter (with 코딩셰프)' 카테고리의 다른 글
[2024.01.09] 플러터(flutter) 조금 매운맛 강좌 05 | 로그인과 주사위게임 (0) | 2024.01.09 |
---|---|
[2023.12.20] 플러터(flutter) 조금 매운맛 강좌 04 | 로그인과 주사위게임 (0) | 2023.12.20 |
[2023.12.08] 플러터(flutter) 조금 매운맛 강좌 02 | Sateful Widget #2 (0) | 2023.12.08 |
[2023.12.04] 플러터(flutter) 조금 매운맛 강좌 01 | Sateful Widget #1 (1) | 2023.12.04 |
[2023.12.01] 플러터(flutter) 순한 맛 강좌 27 | Buttons (0) | 2023.12.01 |