Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
feelver
Overview
Overview
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
2F-ART
feelver
Commits
8dd0cbd8
Commit
8dd0cbd8
authored
Aug 04, 2020
by
Mobile : Ball (Apprentice)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://gitlab.2fellows.com/art/feelver
into develop
parents
ea4aacf0
482cd546
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
296 additions
and
102 deletions
+296
-102
android/app/src/main/AndroidManifest.xml
+4
-0
lib/main.dart
+2
-2
lib/model/Login/login_model.dart
+5
-5
lib/service/api.dart
+22
-2
lib/ui/edit_profile/edit_profile.dart
+20
-2
lib/ui/edit_profile/editprofile_presenter.dart
+112
-64
lib/ui/home/home.dart
+15
-7
lib/ui/home/home_presenter.dart
+49
-1
lib/ui/login/login.dart
+3
-0
lib/ui/login/login_presenter.dart
+7
-6
lib/ui/menu/menu.dart
+57
-13
No files found.
android/app/src/main/AndroidManifest.xml
View file @
8dd0cbd8
...
...
@@ -22,6 +22,10 @@
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
"com.yalantis.ucrop.UCropActivity"
android:screenOrientation=
"portrait"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
...
...
lib/main.dart
View file @
8dd0cbd8
...
...
@@ -25,9 +25,9 @@ class MyApp extends StatelessWidget {
primarySwatch:
Colors
.
blue
,
),
//
home: SplashScreenPage(),
home:
SplashScreenPage
(),
home:
EditProfile
(),
//
home: EditProfile(),
);
}
...
...
lib/model/Login/login_model.dart
View file @
8dd0cbd8
...
...
@@ -24,16 +24,16 @@ class LoginModel {
class
User
{
int
id
;
Null
roleId
;
dynamic
roleId
;
String
name
;
String
email
;
String
avatar
;
Null
emailVerifiedAt
;
dynamic
emailVerifiedAt
;
int
status
;
int
fvRoleId
;
Null
settings
;
Null
createdAt
;
Null
updatedAt
;
dynamic
settings
;
dynamic
createdAt
;
dynamic
updatedAt
;
CustomerInfo
customerInfo
;
User
(
...
...
lib/service/api.dart
View file @
8dd0cbd8
...
...
@@ -19,14 +19,14 @@ class Api<T> {
final
_headerApi
=
{
"Authorization"
:
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OT
Q5NzIzMjYsImV4cCI6MTYwMjE3MjMyNiwibmJmIjoxNTk0OTcyMzI2LCJqdGkiOiJsM1BldUJVcTdDNldSbzVGIiwic3ViIjo1LCJwcnYiOiI4N2UwYWYxZWY5ZmQxNTgxMmZkZWM5NzE1M2ExNGUwYjA0NzU0NmFhIn0.fwFqcbzG2T_ZHtIcGF13Ek7nIxxwbnaE9ZXGomo-nzY
"
,
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYmFja2VuZC11YXQuZmVlbHZlci5jb21cL2FwaVwvbG9naW4iLCJpYXQiOjE1OT
YxMDAzNTgsImV4cCI6MTYwMzMwMDM1OCwibmJmIjoxNTk2MTAwMzU4LCJqdGkiOiJ2YjA2S0FHR1JtZDFseEw1Iiwic3ViIjozNzMsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.UkY70AshvW5O4M63XY_Iv2IPBohSUUwnRF1oi46p2zs
"
,
};
Future
<
Response
<
T
>>
getprofile
(
Object
body
)
async
{
var
_model
;
var
_fail
;
var
result
;
print
(
"this is body "
+
body
.
toString
());
// (body as Map)['lang'] = allTranslations.currentLanguage;
await
_httpConnection
(
"
${this._baseApi}
/customer/info"
,
this
.
_headerApi
,
body
)
...
...
@@ -41,6 +41,26 @@ class Api<T> {
});
return
result
;
}
Future
<
Response
<
T
>>
editProfile
(
Object
body
)
async
{
var
_model
;
var
_fail
;
var
result
;
print
(
"This is body "
+
body
.
toString
());
await
_httpConnection
(
"
${this._baseApi}
/customer/edit"
,
this
.
_headerApi
,
body
)
.
then
((
response
)
{
print
(
"ผลลัพ เท่ากับบบบ "
+
"
${response.body}
"
);
if
(
response
.
statusCode
==
200
)
{
_model
=
FogetPasswordModel
.
fromJson
(
json
.
decode
(
response
.
body
));
}
else
{
_fail
=
FailModel
.
fromJson
(
json
.
decode
(
response
.
body
));
}
result
=
new
Response
<
T
>(
_model
,
_fail
);
});
return
result
;
}
Future
<
Response
<
T
>>
forgetPassword
(
Object
body
)
async
{
var
_model
;
var
_fail
;
...
...
lib/ui/edit_profile/edit_profile.dart
View file @
8dd0cbd8
...
...
@@ -9,6 +9,8 @@ import 'package:flutter/material.dart';
import
'../../util/SizeConfig.dart'
;
class
EditProfile
extends
StatefulWidget
{
String
id
;
EditProfile
({
Key
key
,
this
.
id
,})
:
super
(
key:
key
);
@override
_EditProfileState
createState
()
=>
_EditProfileState
();
}
...
...
@@ -21,13 +23,15 @@ class _EditProfileState extends State<EditProfile> {
super
.
initState
();
presenter
=
EditprofilePresenter
(
this
);
presenter
.
getprofile
();
print
(
"wwww id ="
+
widget
.
id
);
presenter
.
getprofile
(
widget
.
id
);
}
_getImage
()
{
ImagePickerUtil
(
context
,
(
img
)
{
setState
(()
{
image
=
img
;
presenter
.
imageFile
=
img
;
});
});
}
...
...
@@ -75,7 +79,7 @@ class _EditProfileState extends State<EditProfile> {
height:
SizeConfig
.
getWidth
(
100
),
),
)
:
Stack
(
:
presenter
.
getmodel
.
result
[
0
].
image
==
null
?
Stack
(
children:
<
Widget
>[
Container
(
height:
SizeConfig
.
getWidth
(
80
),
...
...
@@ -108,8 +112,20 @@ class _EditProfileState extends State<EditProfile> {
),
)
],
):
ClipRRect
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
SizeConfig
.
getWidth
(
56
))),
child:
Image
.
network
(
presenter
.
getmodel
.
result
[
0
].
image
,
fit:
BoxFit
.
contain
,
width:
SizeConfig
.
getWidth
(
100
),
height:
SizeConfig
.
getWidth
(
100
),
),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
...
...
@@ -317,6 +333,8 @@ class _EditProfileState extends State<EditProfile> {
padding:
EdgeInsets
.
all
(
0.0
),
splashColor:
Colors
.
blueAccent
,
onPressed:
()
{
presenter
.
letCheckData
();
print
(
'name=
${presenter.nameCtrl.text}
'
);
print
(
'lastname=
${presenter.lnameCtrl.text}
'
);
print
(
'email=
${presenter.emailCtrl.text}
'
);
...
...
lib/ui/edit_profile/editprofile_presenter.dart
View file @
8dd0cbd8
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:developer'
;
import
'dart:io'
;
import
'package:feelverapp/model/Login/login_model.dart'
;
import
'package:feelverapp/model/editprofile/getprofilemodel.dart'
;
import
'package:feelverapp/model/forgetpassword/forgetpassModel.dart'
;
import
'package:feelverapp/service/Loading.dart'
;
import
'package:feelverapp/service/api.dart'
;
...
...
@@ -20,61 +21,58 @@ import 'package:rflutter_alert/rflutter_alert.dart';
import
'edit_profile.dart'
;
class
EditprofilePresenter
extends
BasePresenter
<
EditProfile
>
{
Api
_api
;
File
imageFile
;
String
uid
=
"16"
;
final
formKey
=
GlobalKey
<
FormState
>();
String
age
,
lastname
,
firstname
,
sex
,
address
,
email
,
phone
;
GetprofileModel
getmodel
;
TextEditingController
addresCtrl
=
TextEditingController
()
;
TextEditingController
ageCtrl
=
TextEditingController
()
;
TextEditingController
selectedSex
=
TextEditingController
()
;
String
age
,
lastname
,
firstname
,
sex
,
address
,
email
,
phone
;
GetprofileModel
getmodel
;
TextEditingController
addresCtrl
=
TextEditingController
()
;
TextEditingController
ageCtrl
=
TextEditingController
()
;
TextEditingController
selectedSex
=
TextEditingController
()
;
TextEditingController
nameCtrl
=
TextEditingController
();
TextEditingController
phoneCtrl
=
TextEditingController
();
TextEditingController
emailCtrl
=
TextEditingController
();
TextEditingController
lnameCtrl
=
TextEditingController
();
EditprofilePresenter
(
State
<
EditProfile
>
state
)
:
super
(
state
);
letCheckData
()
async
{
letCheckData
()
async
{
try
{
if
(
emailCtrl
.
text
.
isEmpty
)
throw
(
'กรุณากรอก
\n
อีเมล์'
);
Pattern
pattern
=
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+"
;
RegExp
regex
=
new
RegExp
(
pattern
);
if
(!
regex
.
hasMatch
(
emailCtrl
.
text
))
throw
(
'รูปแบบอีเมล์
\n
ไม่ถูกต้อง'
);
else
{
await
getprofile
();
if
(!
regex
.
hasMatch
(
emailCtrl
.
text
))
throw
(
'รูปแบบอีเมล์
\n
ไม่ถูกต้อง'
);
Pattern
pattern2
=
r'(^(?:[+0]9)?[0-9]{10,12}$)'
;
RegExp
regex2
=
new
RegExp
(
pattern2
);
if
(!
regex2
.
hasMatch
(
phoneCtrl
.
text
))
throw
(
'รูปแบบเบอร์โทรศัพท์
\n
ไม่ถูกต้อง'
);
if
(
selectedSex
.
text
!=
"ชาย"
)
{
if
(
selectedSex
.
text
!=
"หญิง"
)
throw
(
'กรุณาระบุเพศ
\n
ชาย/หญิง'
);
else
{
await
letedit
();
print
(
"completeee"
);
}
}
else
{
await
letedit
();
print
(
"completeee"
);
}
}
catch
(
e
)
{
Alert
(
style:
AlertStyle
(
animationType:
AnimationType
.
fromTop
,
isCloseButton:
false
,
),
context:
state
.
context
,
title:
'
$e
'
,
content:
Icon
(
Icons
.
warning
,
color:
Colors
.
orange
,
size:
80
,),
content:
Icon
(
Icons
.
warning
,
color:
Colors
.
orange
,
size:
80
,
),
buttons:
[
DialogButton
(
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
...
...
@@ -86,43 +84,109 @@ else {
)
]).
show
();
}
}
letedit
()
async
{
_api
=
Api
<
FogetPasswordModel
>();
LoadingView
(
state
.
context
).
show
();
var
res
=
await
_api
.
editProfile
({
'id'
:
getmodel
.
result
[
0
].
id
.
toString
(),
'name'
:
nameCtrl
.
text
,
'lastname'
:
lnameCtrl
.
text
,
'phone'
:
phoneCtrl
.
text
,
'email'
:
emailCtrl
.
text
,
'sex'
:
selectedSex
.
text
==
"ชาย"
?
'm'
:
'w'
,
'image'
:
imageFile
!=
null
?
_getImageBase64
()
:
" "
,
});
LoadingView
(
state
.
context
).
hide
();
if
(
res
.
fail
==
null
)
{
Alert
(
style:
AlertStyle
(
animationType:
AnimationType
.
fromTop
,
isCloseButton:
false
,
),
context:
state
.
context
,
title:
"สำเร็จ"
,
content:
Icon
(
Icons
.
check_circle
,
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
size:
80
,
),
buttons:
[
DialogButton
(
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
onPressed:
()
=>
Navigator
.
pop
(
state
.
context
),
child:
Text
(
"ยืนยัน"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
20
),
),
)
]).
show
();
}
else
{
Alert
(
style:
AlertStyle
(
animationType:
AnimationType
.
fromTop
,
isCloseButton:
false
,
),
context:
state
.
context
,
title:
"ไม่สำเร็จ"
,
content:
Icon
(
Icons
.
warning
,
color:
Colors
.
orange
,
size:
80
,
),
buttons:
[
DialogButton
(
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
onPressed:
()
=>
Navigator
.
pop
(
state
.
context
),
child:
Text
(
"ลองอีกครั้ง"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
20
),
),
)
]).
show
();
}
}
getprofile
()
async
{
_getImageBase64
()
{
return
base64
.
encode
(
imageFile
.
readAsBytesSync
());
}
getprofile
(
String
id
)
async
{
_api
=
Api
<
GetprofileModel
>();
var
res
=
await
_api
.
getprofile
({
"id"
:
"16"
"id"
:
id
});
if
(
res
.
fail
==
null
)
{
setState
(()
{
setState
(()
{
getmodel
=
res
.
success
;
ageCtrl
.
text
=
getmodel
.
result
[
0
].
age
.
toString
();
nameCtrl
.
text
=
getmodel
.
result
[
0
].
name
;
lnameCtrl
.
text
=
getmodel
.
result
[
0
].
lastname
;
selectedSex
.
text
=
getmodel
.
result
[
0
].
sex
==
'm'
?
"ชาย"
:
"หญิง"
;
addresCtrl
.
text
=
getmodel
.
result
[
0
].
address
.
toString
();
emailCtrl
.
text
=
getmodel
.
result
[
0
].
email
;
phoneCtrl
.
text
=
getmodel
.
result
[
0
].
phone
.
toString
();
ageCtrl
.
text
=
getmodel
.
result
[
0
].
age
.
toString
();
nameCtrl
.
text
=
getmodel
.
result
[
0
].
name
;
lnameCtrl
.
text
=
getmodel
.
result
[
0
].
lastname
;
selectedSex
.
text
=
getmodel
.
result
[
0
].
sex
==
'm'
?
"ชาย"
:
"หญิง"
;
addresCtrl
.
text
=
getmodel
.
result
[
0
].
address
.
toString
();
emailCtrl
.
text
=
getmodel
.
result
[
0
].
email
;
phoneCtrl
.
text
=
getmodel
.
result
[
0
].
phone
.
toString
();
});
}
else
{
Alert
(
style:
AlertStyle
(
animationType:
AnimationType
.
fromTop
,
isCloseButton:
false
,
),
context:
state
.
context
,
title:
"ไม่สามารถติดต่อ
\n
เซิร์ฟเวอร์ได้"
,
content:
Icon
(
Icons
.
warning
,
color:
Colors
.
orange
,
size:
80
,),
content:
Icon
(
Icons
.
warning
,
color:
Colors
.
orange
,
size:
80
,
),
buttons:
[
DialogButton
(
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
...
...
@@ -135,20 +199,4 @@ else {
]).
show
();
}
}
}
lib/ui/home/home.dart
View file @
8dd0cbd8
...
...
@@ -10,6 +10,9 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter/material.dart'
;
class
HomePage
extends
StatefulWidget
{
String
id
;
String
image
;
HomePage
({
Key
key
,
this
.
id
,
this
.
image
})
:
super
(
key:
key
);
@override
_HomePageState
createState
()
=>
_HomePageState
();
}
...
...
@@ -25,8 +28,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
super
.
initState
();
presenter
=
HomePresenter
(
this
);
presenter
.
Listitem
();
presenter
.
getprofile
(
widget
.
id
.
toString
());
}
...
...
@@ -194,7 +196,8 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
NavDrawer
();
return
presenter
.
getmodel
==
null
?
Container
():
NavDrawer
(
name:
presenter
.
getmodel
.
result
[
0
].
user
.
name
,
id:
presenter
.
getmodel
.
result
[
0
].
id
.
toString
(),
image:
presenter
.
getmodel
.
result
[
0
].
image
,);
});
},
child:
Image
.
asset
(
...
...
@@ -228,12 +231,17 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
MaterialPageRoute
(
builder:
(
context
)
=>
LoginPage
()),
);
},
child:
Container
(
child:
Image
.
asset
(
'assets/images/ic_userimg.png'
,
height:
SizeConfig
.
getWidth
(
30
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
SizeConfig
.
getWidth
(
56
))),
child:
Image
.
network
(
widget
.
image
,
fit:
BoxFit
.
contain
,
width:
SizeConfig
.
getWidth
(
30
),
fit:
BoxFit
.
cover
,
height:
SizeConfig
.
getWidth
(
30
),
),
),
),
),
...
...
lib/ui/home/home_presenter.dart
View file @
8dd0cbd8
import
'package:feelverapp/model/Login/login_model.dart'
;
import
'package:feelverapp/model/category/category_model.dart'
;
import
'package:feelverapp/model/editprofile/getprofilemodel.dart'
;
import
'package:feelverapp/model/home/home_model.dart'
;
import
'package:feelverapp/service/Loading.dart'
;
import
'package:feelverapp/service/api.dart'
;
import
'package:feelverapp/service/base_presenter.dart'
;
import
'package:feelverapp/ui/home/home.dart'
;
import
'package:flutter/material.dart'
;
import
'package:rflutter_alert/rflutter_alert.dart'
;
class
HomePresenter
extends
BasePresenter
<
HomePage
>
{
Api
_api
;
final
formkey
=
GlobalKey
<
FormState
>();
GetprofileModel
getmodel
;
LoginModel
logmodel
;
HomePresenter
(
State
<
HomePage
>
state
)
:
super
(
state
);
Listitem
()
async
{
...
...
@@ -22,4 +28,46 @@ class HomePresenter extends BasePresenter<HomePage> {
print
(
'res Fail'
);
}
}
getprofile
(
String
id
)
async
{
_api
=
Api
<
GetprofileModel
>();
var
res
=
await
_api
.
getprofile
({
"id"
:
id
.
toString
()
});
if
(
res
.
fail
==
null
)
{
setState
(()
{
getmodel
=
res
.
success
;});
print
(
"Hii"
+
getmodel
.
result
[
0
].
name
);
}
else
{
Alert
(
style:
AlertStyle
(
animationType:
AnimationType
.
fromTop
,
isCloseButton:
false
,
),
context:
state
.
context
,
title:
"ไม่สามารถติดต่อ
\n
เซิร์ฟเวอร์ได้"
,
content:
Icon
(
Icons
.
warning
,
color:
Colors
.
orange
,
size:
80
,
),
buttons:
[
DialogButton
(
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
onPressed:
()
=>
Navigator
.
pop
(
state
.
context
),
child:
Text
(
"ลองอีกครั้ง"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
20
),
),
)
]).
show
();
}
}
}
lib/ui/login/login.dart
View file @
8dd0cbd8
...
...
@@ -10,6 +10,8 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter/material.dart'
;
class
LoginPage
extends
StatefulWidget
{
@override
_LoginPageState
createState
()
=>
_LoginPageState
();
}
...
...
@@ -17,6 +19,7 @@ class LoginPage extends StatefulWidget {
class
_LoginPageState
extends
State
<
LoginPage
>
with
TickerProviderStateMixin
{
TabController
_tabController
;
LoginPresenter
presenter
;
@override
void
initState
()
{
// TODO: implement initState
...
...
lib/ui/login/login_presenter.dart
View file @
8dd0cbd8
...
...
@@ -94,7 +94,7 @@ else {
if
(
res
.
fail
==
null
)
{
LoginModel
model
=
res
.
success
;
Alert
(
style:
AlertStyle
(
animationType:
AnimationType
.
fromTop
,
...
...
@@ -107,15 +107,15 @@ else {
buttons:
[
DialogButton
(
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
onPressed:
()
=>
Navigator
.
pushReplacement
(
state
.
context
,
CupertinoPageRoute
(
builder:
(
_
)
=>
HomePage
())),
onPressed:
()
{
Navigator
.
pop
(
state
.
context
);
Navigator
.
pushReplacement
(
state
.
context
,
CupertinoPageRoute
(
builder:
(
_
)
=>
HomePage
(
id:
model
.
user
.
customerInfo
.
id
.
toString
(),
image:
model
.
user
.
customerInfo
.
image
,)));}
,
child:
Text
(
"ตกลง"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
20
),
),
)
]).
show
();
LoginModel
model
=
res
.
success
;
await
AccountUtil
.
saveToken
(
model
.
token
);
print
(
await
AccountUtil
.
getToken
());
// print(AccountUtil.getToken().toString());
...
...
@@ -192,8 +192,9 @@ Navigator.pushReplacement(state.context, CupertinoPageRoute(builder: (_) => Home
buttons:
[
DialogButton
(
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
onPressed:
()
=>
Navigator
.
pushReplacement
(
state
.
context
,
CupertinoPageRoute
(
builder:
(
_
)
=>
HomePage
())),
onPressed:
()
{
Navigator
.
pop
(
state
.
context
);
Navigator
.
pushReplacement
(
state
.
context
,
CupertinoPageRoute
(
builder:
(
_
)
=>
HomePage
()));}
,
child:
Text
(
"ตกลง"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
20
),
...
...
lib/ui/menu/menu.dart
View file @
8dd0cbd8
import
'package:feelverapp/ui/ForgetPassword/forgetpassword.dart'
;
import
'package:feelverapp/ui/edit_profile/edit_profile.dart'
;
import
'package:feelverapp/ui/home/home.dart'
;
import
'package:feelverapp/ui/login/login.dart'
;
import
'package:feelverapp/ui/login/login_presenter.dart'
;
import
'package:feelverapp/ui/register/register_email.dart'
;
//import 'package:feelverapp/ui/login/login_presenter.dart';
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
class
NavDrawer
extends
StatelessWidget
{
class
NavDrawer
extends
StatefulWidget
{
String
id
;
String
name
;
String
image
;
String
lastname
;
NavDrawer
({
Key
key
,
this
.
name
,
this
.
lastname
,
this
.
image
,
this
.
id
,})
:
super
(
key:
key
);
@override
_NavDrawerState
createState
()
=>
_NavDrawerState
();
}
class
_NavDrawerState
extends
State
<
NavDrawer
>
with
TickerProviderStateMixin
{
@override
Widget
build
(
BuildContext
context
)
{
return
Padding
(
...
...
@@ -14,37 +34,58 @@ class NavDrawer extends StatelessWidget {
child:
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
Stack
(
widget
.
image
==
null
?
Stack
(
children:
<
Widget
>[
Container
(
height:
SizeConfig
.
getWidth
(
80
),
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
),
Container
(
alignment:
Alignment
.
topCenter
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
10
),
top:
SizeConfig
.
getPadding
(
24
)),
child:
Image
.
asset
(
'assets/images/ic_userimg.png'
,
top:
SizeConfig
.
getPadding
(
30
)),
child:
Container
(
decoration:
BoxDecoration
(
color:
Color
.
fromRGBO
(
238
,
175
,
183
,
1
),
shape:
BoxShape
.
circle
,
border:
Border
.
all
(
color:
Colors
.
white
,
width:
1.4
)),
width:
SizeConfig
.
getWidth
(
100
),
height:
SizeConfig
.
getWidth
(
100
),
),
),
Container
(
alignment:
Alignment
.
topCenter
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
9
0
),
top:
SizeConfig
.
getPadding
(
100
)),
left:
SizeConfig
.
getPadding
(
1
0
),
top:
SizeConfig
.
getPadding
(
65
)),
child:
Image
.
asset
(
'assets/images/ic_camera.png'
,
width:
SizeConfig
.
getWidth
(
30
),
height:
SizeConfig
.
getWidth
(
30
),
),
'assets/images/ic_camera_profile.png'
,
width:
SizeConfig
.
getWidth
(
34
),
height:
SizeConfig
.
getWidth
(
34
),
),
)
],
):
ClipRRect
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
SizeConfig
.
getWidth
(
56
))),
child:
Image
.
network
(
widget
.
image
,
fit:
BoxFit
.
contain
,
width:
SizeConfig
.
getWidth
(
100
),
height:
SizeConfig
.
getWidth
(
100
),
),
),
Container
(
padding:
EdgeInsets
.
only
(
top:
SizeConfig
.
getPadding
(
20
),
),
alignment:
Alignment
.
center
,
child:
Text
(
'
John wick
'
,
'
${widget.name}
'
,
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
SizeConfig
.
getFontSize
(
24
),
...
...
@@ -64,7 +105,7 @@ class NavDrawer extends StatelessWidget {
onTap:
()
{
Navigator
.
push
(
context
,
CupertinoPageRoute
(
builder:
(
context
)
=>
EditProfile
(),),
CupertinoPageRoute
(
builder:
(
context
)
=>
EditProfile
(
id:
widget
.
id
),),
);
},
child:
Container
(
...
...
@@ -321,3 +362,6 @@ class NavDrawer extends StatelessWidget {
);
}
}
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