[Flutter] - 6일차 과제

sang hyeok Lee·2023년 3월 29일
0

import 'dart:math';

import 'package:contact_app/DrinkTile.dart';
import 'package:flutter/material.dart';

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

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

  
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.transparent,
          elevation: 0,
          leading: const Icon(
            Icons.navigate_before,
            color: Colors.black,
          ),
          actions: const [
            Padding(
              padding: EdgeInsets.only(right: 10),
              child: Icon(
                Icons.search,
                color: Colors.black,
              ),
            ),
          ],
        ),
        body: Padding(
          padding: const EdgeInsets.all(16),
          child: ListView(
            children: const [
              Text(
                "NEW",
                style: TextStyle(
                  fontSize: 32,
                  fontWeight: FontWeight.bold,
                ),
              ),
              SizedBox(
                height: 16,
              ),
              DrinkTile(
                koreaName: "골든 미모사 그린 티",
                englishName: "Golden Mimosa Green Tea",
                imgUrl: "assets/item_drink1.jpeg",
                price: "6100원",
              ),
              DrinkTile(
                koreaName: "블랙 햅쌀 고봉 라떼",
                englishName: "Black Rice Latte",
                imgUrl: "assets/item_drink2.jpeg",
                price: "6300원",
              ),
              DrinkTile(
                koreaName: "아이스 블랙 햅쌀 고봉 라떼",
                englishName: "Iced Black Rice Latte",
                imgUrl: "assets/item_drink3.jpeg",
                price: "6300원",
              ),
              DrinkTile(
                koreaName: "스타벅스 튜메릭 라떼",
                englishName: "Starbucks Turmeric Latte",
                imgUrl: "assets/item_drink4.jpeg",
                price: "6100원",
              ),
              DrinkTile(
                koreaName: "아이스 스타벅스 튜메릭 라떼",
                englishName: "Iced Starbucks Turmeric Latte",
                imgUrl: "assets/item_drink5.jpeg",
                price: "6100원",
              ),
            ],
          ),
        ),
        bottomSheet: Container(
          padding: const EdgeInsets.symmetric(horizontal: 16),
          height: 54,
          color: Colors.black87,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: const [
              Text(
                "주문할 매장을 선택해주세요.",
                style: TextStyle(
                  color: Colors.white,
                ),
              ),
              Icon(
                Icons.expand_more,
                color: Colors.white,
              ),
            ],
          ),
        ),
        bottomNavigationBar: BottomNavigationBar(
          type: BottomNavigationBarType.fixed,
          currentIndex: 2,
          selectedItemColor: Colors.green,
          items: const [
            BottomNavigationBarItem(
              icon: Icon(
                Icons.home,
              ),
              label: "Home",
            ),
            BottomNavigationBarItem(
              icon: Icon(
                Icons.payment,
              ),
              label: "Pay",
            ),
            BottomNavigationBarItem(
              icon: Icon(
                Icons.coffee,
              ),
              label: "Order",
            ),
            BottomNavigationBarItem(
              icon: Icon(Icons.shop),
              label: "Shop",
            ),
            BottomNavigationBarItem(
              icon: Icon(Icons.more_horiz),
              label: "Other",
            ),
          ],
        ),
      ),
    );
  }
}
profile
개발자 되기

0개의 댓글