From b42693b2b755b62ff6d3c67f2e884ef12105824f Mon Sep 17 00:00:00 2001 From: wonbin <wonbin3977@gmail.com> Date: Wed, 30 Apr 2025 18:02:06 +0900 Subject: [PATCH] checklist_item --- lib/checklist_item.dart | 22 ++++++++++++++++++++++ lib/checklist_view.dart | 33 +++++++++++++++++++++++++++++++++ lib/main.dart | 2 +- lib/view.dart | 21 --------------------- 4 files changed, 56 insertions(+), 22 deletions(-) create mode 100644 lib/checklist_item.dart create mode 100644 lib/checklist_view.dart delete mode 100644 lib/view.dart diff --git a/lib/checklist_item.dart b/lib/checklist_item.dart new file mode 100644 index 0000000..d875295 --- /dev/null +++ b/lib/checklist_item.dart @@ -0,0 +1,22 @@ +// checklist_item.dart + +import 'package:flutter/material.dart'; + +class ChecklistItem extends StatefulWidget { + final String title; + ChecklistItem({required this.title}); + @override + State<StatefulWidget> createState() => _ChecklistItem(); +} + +class _ChecklistItem extends State<ChecklistItem> { + @override + Widget build(BuildContext context) { + return GestureDetector( + child: Container( + child: Text('widget.title'), + ) + ); + } +} + diff --git a/lib/checklist_view.dart b/lib/checklist_view.dart new file mode 100644 index 0000000..c70011f --- /dev/null +++ b/lib/checklist_view.dart @@ -0,0 +1,33 @@ +// checklist_view.dart + +import 'package:flutter/material.dart'; +import 'package:flutter_application_1/checklist_item.dart'; + +class ChecklistView extends StatefulWidget { + @override + State<StatefulWidget> createState() { + return _ChecklistView(); + } +} + +class _ChecklistView extends State<ChecklistView> { + List<String> checklist = [ + "실전코딩 과제", + "실전코딩 복습", + "게임" + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text('Checklist')), + body: Container( + child: Column( + children: List<Widget>.generate(checklist.length, (index) { + return ChecklistItem(title: checklist[index]); + }), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 0271fdf..3f13bc3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_application_1/view.dart'; +import 'package:flutter_application_1/checklist_view.dart'; void main() { runApp(MyApp()); diff --git a/lib/view.dart b/lib/view.dart deleted file mode 100644 index bf36ff0..0000000 --- a/lib/view.dart +++ /dev/null @@ -1,21 +0,0 @@ -// checklist_view.dart - -import 'package:flutter/material.dart'; - -class ChecklistView extends StatefulWidget { - @override - State<StatefulWidget> createState() => _ChecklistView(); -} - -class _ChecklistView extends State<ChecklistView> { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: const Text('checklist')), - body: Container( - - ) - ); - } -} - -- GitLab