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

page_layout-3

parent 35145dba
Branches
No related tags found
No related merge requests found
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,
body: Center(
child: GestureDetector(
onTap: _moveView,
child: Container(
height: 40,
width: 40,
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),
),
],
border: Border.all(color: Colors.black),
),
],
),
),
),
......
// 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