Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
library-app-flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ilham Maulana
library-app-flutter
Commits
057213c1
Commit
057213c1
authored
Aug 02, 2024
by
Ilham Maulana
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: refactor profile edit screen
parent
1cce6951
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
36 deletions
+39
-36
form_screen.dart
lib/src/screens/form_screen.dart
+0
-35
profile_edit_screen.dart
lib/src/screens/profile_edit_screen.dart
+38
-0
profile.dart
lib/src/widgets/profile.dart
+1
-1
No files found.
lib/src/screens/form_screen.dart
View file @
057213c1
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:go_router/go_router.dart'
;
import
'package:go_router/go_router.dart'
;
import
'package:library_app/src/providers/auth_provider.dart'
;
import
'package:library_app/src/widgets/forms/login_form.dart'
;
import
'package:library_app/src/widgets/forms/login_form.dart'
;
import
'package:library_app/src/widgets/forms/profile_edit_form.dart'
;
import
'package:library_app/src/widgets/forms/reset_password_form.dart'
;
import
'package:library_app/src/widgets/forms/reset_password_form.dart'
;
import
'package:library_app/src/widgets/forms/sign_up_form.dart'
;
import
'package:library_app/src/widgets/forms/sign_up_form.dart'
;
import
'package:provider/provider.dart'
;
class
FormScreen
extends
StatefulWidget
{
class
FormScreen
extends
StatefulWidget
{
final
String
title
;
final
String
title
;
...
@@ -121,35 +118,3 @@ class ConfirmResetPasswordScreen extends StatelessWidget {
...
@@ -121,35 +118,3 @@ class ConfirmResetPasswordScreen extends StatelessWidget {
);
);
}
}
}
}
class
ProfileEditScreen
extends
StatelessWidget
{
const
ProfileEditScreen
({
super
.
key
,
});
@override
Widget
build
(
BuildContext
context
)
{
String
title
=
"Edit Profile"
;
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
title
),
leading:
BackButton
(
onPressed:
()
=>
context
.
pop
(),
),
),
body:
Consumer
<
AuthProvider
>(
builder:
(
context
,
authProvider
,
child
)
{
return
ListView
(
children:
[
Container
(
width:
double
.
infinity
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
,
vertical:
40.0
),
child:
ProfileEditForm
(
user:
authProvider
.
user
),
),
]);
},
),
);
}
}
lib/src/screens/profile_edit_screen.dart
0 → 100644
View file @
057213c1
import
'package:flutter/material.dart'
;
import
'package:provider/provider.dart'
;
import
'package:go_router/go_router.dart'
;
import
'package:library_app/src/providers/auth_provider.dart'
;
import
'package:library_app/src/widgets/forms/profile_edit_form.dart'
;
class
ProfileEditScreen
extends
StatelessWidget
{
const
ProfileEditScreen
({
super
.
key
,
});
@override
Widget
build
(
BuildContext
context
)
{
String
title
=
"Edit Profile"
;
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
title
),
leading:
BackButton
(
onPressed:
()
=>
context
.
pop
(),
),
),
body:
Consumer
<
AuthProvider
>(
builder:
(
context
,
authProvider
,
child
)
{
return
ListView
(
children:
[
Container
(
width:
double
.
infinity
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
,
vertical:
40.0
),
child:
ProfileEditForm
(
user:
authProvider
.
user
),
),
]);
},
),
);
}
}
lib/src/widgets/profile.dart
View file @
057213c1
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:library_app/src/providers/auth_provider.dart'
;
import
'package:library_app/src/providers/auth_provider.dart'
;
import
'package:library_app/src/screens/
form
_screen.dart'
;
import
'package:library_app/src/screens/
profile_edit
_screen.dart'
;
import
'package:library_app/src/widgets/navigations.dart'
;
import
'package:library_app/src/widgets/navigations.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment