[Flutter] 앱 레퍼런스 참고하여 Flutter로 화면 구현하기 2

2024. 11. 7. 13:14·Flutter
구현할 화면

 

import 'package:flutter/material.dart';

void main() {
  runApp(const LoginApp());
}

class LoginApp extends StatelessWidget {
  const LoginApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: const LoginPage(),
    );
  }
}

class LoginPage extends StatelessWidget {
  const LoginPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color(0xFFFFF9F6),
      appBar: AppBar(
        title: Text('로그인'),
        backgroundColor: Color(0xFFFFF9F6),
      ),
      body: Center(
        child: SingleChildScrollView(
          child: Padding(
            padding: EdgeInsets.all(30.0),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                 FlutterLogo(size: 100),
                 SizedBox(height: 40),
                TextField(
                  decoration: InputDecoration(
                    labelText: '이메일',
                    border: OutlineInputBorder(
                      borderRadius: BorderRadius.circular(4.0),
                    ),
                    fillColor: Color(0xFFFEDDBD),
                    filled: true,
                    prefixIcon: Icon(Icons.email_outlined),
                  ),
                ),
                SizedBox(height: 20),
                TextField(
                  decoration: InputDecoration(
                    labelText: '비밀번호',
                    border: OutlineInputBorder(
                      borderRadius: BorderRadius.circular(4.0),
                    ),
                    fillColor: Color(0xFFFEDDBD),
                    filled: true,
                    prefixIcon: Icon(Icons.lock_outline),
                  ),
                  obscureText: true,
                ),
                SizedBox(height: 20),
                ElevatedButton(
                  onPressed: () {},
                  style: ElevatedButton.styleFrom(
                    backgroundColor: Color(0xFF845318),
                    padding: EdgeInsets.symmetric(
                        horizontal: 35, vertical: 15),
                  ),
                  child: Text('로그인',  style: TextStyle(color: Colors.white),),
                ),
                SizedBox(height: 20),
                TextButton(
                  onPressed: () {},
                  child: Text('비밀번호를 잊으셨나요?' , style: TextStyle(color: Color(0xFF845318)),),
                ),
                SizedBox(height: 10),
                Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text('계정이 없으신가요?'),
                    TextButton(
                      onPressed: () {},
                      child: Text('회원가입', style: TextStyle(color: Color(0xFF845318)),),
                    ),
                  ],
                ),
                const Divider(), // 구분선 추가
                SizedBox(height: 20),
                ElevatedButton.icon(
                  onPressed: () {},
                  icon: Icon(Icons.g_mobiledata),
                  label: Text('Google로 로그인'),
                  style: ElevatedButton.styleFrom(
                    backgroundColor: Color(0xFFFEDDBD),
                    foregroundColor: Colors.black,
                    padding: EdgeInsets.symmetric(
                        horizontal: 40, vertical: 13),
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

'Flutter' 카테고리의 다른 글

[Flutter] Form 위젯 연습 (피드백 폼 앱)  (0) 2024.11.11
[Flutter] 플러터 기본기 다지기 - 3 (Form 위젯)  (0) 2024.11.11
[Flutter] SingleChildScrollView 위젯  (0) 2024.11.07
[Flutter] 앱 레퍼런스 참고하여 Flutter로 화면 구현하기  (1) 2024.11.06
[Flutter] 텍스트 폰트 설정하기  (0) 2024.11.06
'Flutter' 카테고리의 다른 글
  • [Flutter] Form 위젯 연습 (피드백 폼 앱)
  • [Flutter] 플러터 기본기 다지기 - 3 (Form 위젯)
  • [Flutter] SingleChildScrollView 위젯
  • [Flutter] 앱 레퍼런스 참고하여 Flutter로 화면 구현하기
미로910
미로910
개발자를 꿈꾸는 민경이의 기록 블로그
  • 미로910
    개발 note
    미로910
  • 전체
    오늘
    어제
    • 분류 전체보기
      • 설치 메뉴얼
      • HTML
      • JAVA
        • Java 기초
        • Java 응용
        • 자료구조
        • HTTP
        • JSP 프로그래밍
      • MySQL
        • MySQL 기본
        • 1일 1쿼리
      • CSS
      • Spring boot
      • JS
        • 게시판 만들기
      • Git
      • Flutter
        • MVVM 활용
        • 심화 버전
        • 1일 1 Flutter
      • 디자인 패턴의 활용
      • error note
      • My Project
        • [졸작] LLM 기반 특허 유사도 분석 시스템
        • 도서 관리 프로그램 (final project)
        • amigo
        • 친구 매칭 프로그램(FMP)
      • Python
      • 딥러닝
      • 네트워크
      • 공부 노트
        • 연구회
        • 자료구조
      • 기타
  • 블로그 메뉴

    • 홈
    • 전체보기
    • -----------------------
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    Flutter
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.6
미로910
[Flutter] 앱 레퍼런스 참고하여 Flutter로 화면 구현하기 2
상단으로

티스토리툴바