Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Flutter Application 1
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 Application 1
Commits
2495701b
Commit
2495701b
authored
1 year ago
by
NOOBJE
Browse files
Options
Downloads
Patches
Plain Diff
8단계완료
parent
9b674350
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/main.dart
+31
-4
31 additions, 4 deletions
lib/main.dart
with
31 additions
and
4 deletions
lib/main.dart
+
31
−
4
View file @
2495701b
...
@@ -46,8 +46,6 @@ class MyAppState extends ChangeNotifier {
...
@@ -46,8 +46,6 @@ class MyAppState extends ChangeNotifier {
}
}
// ...
class
MyHomePage
extends
StatefulWidget
{
class
MyHomePage
extends
StatefulWidget
{
@override
@override
State
<
MyHomePage
>
createState
()
=
>
_MyHomePageState
();
State
<
MyHomePage
>
createState
()
=
>
_MyHomePageState
();
...
@@ -64,7 +62,7 @@ switch (selectedIndex) {
...
@@ -64,7 +62,7 @@ switch (selectedIndex) {
page
=
GeneratorPage
();
page
=
GeneratorPage
();
break
;
break
;
case
1
:
case
1
:
page
=
Placeholder
();
page
=
FavoritesPage
();
break
;
break
;
default
:
default
:
throw
UnimplementedError
(
'no widget for
$selectedIndex
'
);
throw
UnimplementedError
(
'no widget for
$selectedIndex
'
);
...
@@ -97,7 +95,7 @@ switch (selectedIndex) {
...
@@ -97,7 +95,7 @@ switch (selectedIndex) {
Expanded
(
Expanded
(
child:
Container
(
child:
Container
(
color:
Theme
.
of
(
context
)
.
colorScheme
.
primaryContainer
,
color:
Theme
.
of
(
context
)
.
colorScheme
.
primaryContainer
,
child:
GeneratorP
age
()
,
child:
p
age
,
),
),
),
),
],
],
...
@@ -153,6 +151,35 @@ class GeneratorPage extends StatelessWidget {
...
@@ -153,6 +151,35 @@ class GeneratorPage extends StatelessWidget {
}
}
// ...
class
FavoritesPage
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
var
appState
=
context
.
watch
<
MyAppState
>();
if
(
appState
.
favorites
.
isEmpty
)
{
return
Center
(
child:
Text
(
'No favorites yet.'
),
);
}
return
ListView
(
children:
[
Padding
(
padding:
const
EdgeInsets
.
all
(
20
),
child:
Text
(
'You have '
'
${appState.favorites.length}
favorites:'
),
),
for
(
var
pair
in
appState
.
favorites
)
ListTile
(
leading:
Icon
(
Icons
.
favorite
),
title:
Text
(
pair
.
asLowerCase
),
),
],
);
}
}
class
BigCard
extends
StatelessWidget
{
class
BigCard
extends
StatelessWidget
{
const
BigCard
({
const
BigCard
({
...
...
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