Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Second 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
현민 정
Second Flutter
Commits
a9cc43cf
Commit
a9cc43cf
authored
2 months ago
by
현민 정
Browse files
Options
Downloads
Patches
Plain Diff
onTab 구현
parent
7775faf9
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
+10
-1
10 additions, 1 deletion
lib/checklist_view.dart
lib/main.dart
+0
-1
0 additions, 1 deletion
lib/main.dart
with
45 additions
and
2 deletions
lib/checklist_item.dart
+
35
−
0
View file @
a9cc43cf
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
>
{
bool
_isChecked
=
false
;
void
_check
()
{
setState
(()
{
_isChecked
=
!
_isChecked
;
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
GestureDetector
(
onTap:
_check
,
child:
Container
(
child:
Text
(
widget
.
title
,
style:
TextStyle
(
color:
_isChecked
?
Colors
.
grey
:
Colors
.
black
,
decoration:
_isChecked
?
TextDecoration
.
lineThrough
:
null
,
),
),
),
);
}
}
This diff is collapsed.
Click to expand it.
lib/checklist_view.dart
+
10
−
1
View file @
a9cc43cf
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:second_flutter/checklist_item.dart'
;
class
ChecklistView
extends
StatefulWidget
{
class
ChecklistView
extends
StatefulWidget
{
@override
@override
...
@@ -8,11 +9,19 @@ class ChecklistView extends StatefulWidget {
...
@@ -8,11 +9,19 @@ class ChecklistView extends StatefulWidget {
}
}
class
_ChecklistView
extends
State
<
ChecklistView
>
{
class
_ChecklistView
extends
State
<
ChecklistView
>
{
List
<
String
>
checklist
=
[
"집가고싶다"
,
"과제해야돼"
,
"으아아아악"
];
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'checklist'
)),
appBar:
AppBar
(
title:
const
Text
(
'checklist'
)),
body:
Container
(),
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
+
0
−
1
View file @
a9cc43cf
// main.dart
// main.dart
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:second_flutter/checklist_item.dart'
;
import
'package:second_flutter/checklist_view.dart'
;
import
'package:second_flutter/checklist_view.dart'
;
void
main
()
{
void
main
()
{
...
...
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