Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flutter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
황 재인
flutter
Commits
d5ba296d
Commit
d5ba296d
authored
2 months ago
by
JM-220
Browse files
Options
Downloads
Patches
Plain Diff
fourth
parent
0d24d5e6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/checklist_item.dart
+35
-0
35 additions, 0 deletions
lib/checklist_item.dart
lib/checklist_view.dart
+28
-0
28 additions, 0 deletions
lib/checklist_view.dart
lib/main.dart
+14
-33
14 additions, 33 deletions
lib/main.dart
with
77 additions
and
33 deletions
lib/checklist_item.dart
0 → 100644
+
35
−
0
View file @
d5ba296d
import
'package:flutter/material.dart'
;
class
ChecklistItem
extends
StatefulWidget
{
final
String
title
;
const
ChecklistItem
({
Key
?
key
,
required
this
.
title
})
:
super
(
key:
key
);
@override
State
<
StatefulWidget
>
createState
()
=
>
_ChecklistItem
();
}
class
_ChecklistItem
extends
State
<
ChecklistItem
>
{
bool
_isChecked
=
false
;
void
_check
()
{
setState
(()
{
_isChecked
=
!
_isChecked
;
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
GestureDetector
(
onTap:
_check
,
child:
Container
(
height:
32
,
child:
Text
(
widget
.
title
,
style:
TextStyle
(
color:
_isChecked
?
Colors
.
grey
:
Colors
.
black
,
decoration:
_isChecked
?
TextDecoration
.
lineThrough
:
TextDecoration
.
none
,
),
),
),
);
}
}
This diff is collapsed.
Click to expand it.
lib/checklist_view.dart
0 → 100644
+
28
−
0
View file @
d5ba296d
// checklist_view.dart
import
'package:flutter/material.dart'
;
import
'package:my_flutter_app/checklist_item.dart'
;
class
ChecklistView
extends
StatefulWidget
{
@override
State
<
StatefulWidget
>
createState
()
=
>
_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
]);
}),
),
),
);
}
}
This diff is collapsed.
Click to expand it.
lib/main.dart
+
14
−
33
View file @
d5ba296d
// main.dart
// main.dart
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:my_flutter_app/checklist_view.dart'
;
void
main
()
{
void
main
()
{
runApp
(
const
MyApp
());
runApp
(
const
MyApp
());
...
@@ -25,45 +26,25 @@ class MyHomePage extends StatefulWidget {
...
@@ -25,45 +26,25 @@ class MyHomePage extends StatefulWidget {
}
}
class
_MyHomePage
extends
State
<
MyHomePage
>
{
class
_MyHomePage
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
(
title:
Text
(
widget
.
title
)),
appBar:
AppBar
(
title:
Text
(
widget
.
title
)),
body:
Container
(
body:
Container
(
margin:
EdgeInsets
.
all
(
20
),
child:
GestureDetector
(
onTap:
_moveView
,
padding:
EdgeInsets
.
symmetric
(
vertical:
20
,
horizontal:
20
),
child:
Container
(
height:
40
,
child:
Center
(
width:
40
,
child:
Column
(
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
Colors
.
black
)),
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
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
.
start
,
children:
[
Text
(
'text in Row'
),
Container
(
width:
100
,
height:
100
,
child:
Icon
(
Icons
.
flag
)),
],
),
],
),
),
),
),
),
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment