ListView 사용

Louie De Janeiro·2023년 5월 15일
0

Flutter

목록 보기
3/3
post-thumbnail

ListView

import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'TO DO'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: ListView(
        padding: const EdgeInsets.all(10),
        children: [
          const Text(
            "오늘 하루",
            style: TextStyle(color: Colors.green, fontWeight: FontWeight.bold),
          ),
          Container(
            height: 10,
          ),
          const Text(
            "TO DOs",
            style: TextStyle(color: Colors.cyan),
          ),
          Container(
            height: 10,
          ),
          const Text(
            "완료된 하루",
            style: TextStyle(color: Colors.grey, fontWeight: FontWeight.bold),
          )
        ],
      ),
    );
  }
}
profile
배고프다

0개의 댓글