diff --git a/lib/main.dart b/lib/main.dart index c9323b0f7e7a0bc10c148a0ba6d9de0fe45cc0d0..0271fdf7e7acb0692740d8d6fdfad21b4fe954b6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_application_1/view.dart'; void main() { runApp(MyApp()); @@ -10,7 +11,7 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - home: MyHomePage(title: 'My Flutter App'), // const 제거 + home: MyHomePage(title: 'My Flutter App'), ); } } @@ -24,40 +25,30 @@ class MyHomePage extends StatefulWidget { } class _MyHomePageState extends State<MyHomePage> { + void _moveView() { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ChecklistView(), + ), + ); + } + @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.title), ), - body: Container( - margin: EdgeInsets.all(20), - padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20), - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 200, - height: 100, - decoration: BoxDecoration( - border: Border.all(color: Colors.black, width: 2), - ), - child: Text('text in box'), - ), - Text('text outside of box'), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text('text in Row'), - Container( - width: 100, - height: 100, - child: Icon(Icons.flag), - ), - ], - ), - ], + body: Center( + child: GestureDetector( + onTap: _moveView, + child: Container( + height: 40, + width: 40, + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + ), ), ), ), diff --git a/lib/view.dart b/lib/view.dart new file mode 100644 index 0000000000000000000000000000000000000000..bf36ff07657e4f10454e03687a5bd48deecf028a --- /dev/null +++ b/lib/view.dart @@ -0,0 +1,21 @@ +// 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( + + ) + ); + } +} +