Skip to content
Snippets Groups Projects
Commit b059acb9 authored by wonbin's avatar wonbin
Browse files

page_layout-3

parent 35145dba
No related branches found
No related tags found
No related merge requests found
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_application_1/view.dart';
void main() { void main() {
runApp(MyApp()); runApp(MyApp());
...@@ -10,7 +11,7 @@ class MyApp extends StatelessWidget { ...@@ -10,7 +11,7 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
home: MyHomePage(title: 'My Flutter App'), // const 제거 home: MyHomePage(title: 'My Flutter App'),
); );
} }
} }
...@@ -24,40 +25,30 @@ class MyHomePage extends StatefulWidget { ...@@ -24,40 +25,30 @@ class MyHomePage extends StatefulWidget {
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
void _moveView() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChecklistView(),
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(widget.title), title: Text(widget.title),
), ),
body: Container( body: Center(
margin: EdgeInsets.all(20), child: GestureDetector(
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20), onTap: _moveView,
child: Center( child: Container(
child: Column( height: 40,
mainAxisAlignment: MainAxisAlignment.spaceBetween, width: 40,
children: [
Container(
width: 200,
height: 100,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.black, width: 2), border: Border.all(color: Colors.black),
),
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),
),
],
), ),
],
), ),
), ),
), ),
......
// 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(
)
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment