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
f29f2aad
Commit
f29f2aad
authored
Jul 29, 2020
by
Mobile : Jetrin Phuekkaew (N'new)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
ff1456fd
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
488 additions
and
239 deletions
+488
-239
android/app/src/main/AndroidManifest.xml
+1
-0
ios/Podfile.lock
+25
-0
ios/Runner.xcodeproj/project.pbxproj
+6
-1
ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+8
-0
ios/Runner/Info.plist
+11
-1
lib/main.dart
+1
-1
lib/service/image_picker_util.dart
+100
-0
lib/ui/edit_profile/edit_profile.dart
+290
-234
lib/ui/edit_profile/editprofile_presenter.dart
+16
-2
pubspec.lock
+28
-0
pubspec.yaml
+2
-0
No files found.
android/app/src/main/AndroidManifest.xml
View file @
f29f2aad
...
...
@@ -10,6 +10,7 @@
android:label=
"feelverapp"
android:icon=
"@mipmap/ic_launcher"
>
<activity
android:name=
".MainActivity"
android:launchMode=
"singleTop"
android:theme=
"@style/LaunchTheme"
...
...
ios/Podfile.lock
View file @
f29f2aad
PODS:
- Flutter (1.0.0)
- flutter_plugin_android_lifecycle (0.0.1):
- Flutter
- image_cropper (0.0.2):
- Flutter
- TOCropViewController (~> 2.5.2)
- image_picker (0.0.1):
- Flutter
- path_provider_linux (0.0.1):
- Flutter
- shared_preferences (0.0.1):
...
...
@@ -10,18 +17,32 @@ PODS:
- Flutter
- shared_preferences_web (0.0.1):
- Flutter
- TOCropViewController (2.5.3)
DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
SPEC REPOS:
trunk:
- TOCropViewController
EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_plugin_android_lifecycle:
:path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios"
image_cropper:
:path: ".symlinks/plugins/image_cropper/ios"
image_picker:
:path: ".symlinks/plugins/image_picker/ios"
path_provider_linux:
:path: ".symlinks/plugins/path_provider_linux/ios"
shared_preferences:
...
...
@@ -35,11 +56,15 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
image_cropper: 3c16d7651730ffe85897f5a1c4e2547e6b54989a
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
TOCropViewController: 20a14b6a7a098308bf369e7c8d700dc983a974e6
PODFILE CHECKSUM: 1b66dae606f75376c5f2135a8290850eeb09ae83
...
...
ios/Runner.xcodeproj/project.pbxproj
View file @
f29f2aad
...
...
@@ -86,7 +86,6 @@
33024327C221F515472E9F1F
/* Pods-Runner.release.xcconfig */
,
79C89B9F733C7608F23FFD16
/* Pods-Runner.profile.xcconfig */
,
);
name
=
Pods
;
path
=
Pods
;
sourceTree
=
"<group>"
;
};
...
...
@@ -181,7 +180,9 @@
TargetAttributes
=
{
97C146ED1CF9000F007C117D
=
{
CreatedOnToolsVersion
=
7.3.1
;
DevelopmentTeam
=
DDWPE4NQAQ
;
LastSwiftMigration
=
1100
;
ProvisioningStyle
=
Automatic
;
};
};
};
...
...
@@ -508,7 +509,10 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CLANG_ENABLE_MODULES
=
YES
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
"$(FLUTTER_BUILD_NUMBER)"
;
DEVELOPMENT_TEAM
=
DDWPE4NQAQ
;
ENABLE_BITCODE
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -522,6 +526,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.2fellows.feelverapp
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
SWIFT_OBJC_BRIDGING_HEADER
=
"Runner/Runner-Bridging-Header.h"
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
SWIFT_VERSION
=
5.0
;
...
...
ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
0 → 100644
View file @
f29f2aad
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
IDEDidComputeMac32BitWarning
<
/k
e
y
>
<
tru
e
/
>
<
/
d
i
c
t
>
<
/plist
>
ios/Runner/Info.plist
View file @
f29f2aad
...
...
@@ -41,5 +41,15 @@
<
/
a
rr
a
y
>
<
k
e
y
>
UIViewControllerBasedStatusBarAppearance
<
/k
e
y
>
<
fa
ls
e
/
>
<
/
d
i
c
t
>
<
k
e
y
>
NSPhotoLibraryUsageDescription
<
/k
e
y
>
<
string
>
Need
to
upload
image
<
/string
>
<
k
e
y
>
NSCameraUsageDescription
<
/k
e
y
>
<
string
>
Need
to
upload
image
<
/string
>
<
k
e
y
>
NSMicrophoneUsageDescription
<
/k
e
y
>
<
string
>
Need
to
upload
image
<
/string
>
<
/
d
i
c
t
>
<
/plist
>
lib/main.dart
View file @
f29f2aad
...
...
@@ -27,7 +27,7 @@ class MyApp extends StatelessWidget {
// home: SplashScreenPage(),
home:
ShopList
(),
home:
EditProfile
(),
);
}
...
...
lib/service/image_picker_util.dart
0 → 100644
View file @
f29f2aad
import
'dart:io'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:image_cropper/image_cropper.dart'
;
import
'package:image_picker/image_picker.dart'
;
class
ImagePickerUtil
{
final
BuildContext
context
;
final
Function
callback
;
ImagePickerUtil
(
this
.
context
,
this
.
callback
)
{
showCupertinoModalPopup
(
context:
context
,
builder:
(
context
)
{
return
CupertinoActionSheet
(
actions:
<
Widget
>[
Container
(
child:
CupertinoActionSheetAction
(
onPressed:
()
async
{
var
res
=
await
_imagePick
(
ImageSource
.
camera
);
this
.
callback
(
res
);
},
child:
Row
(
children:
<
Widget
>[
Icon
(
Icons
.
camera
,
color:
Colors
.
black87
,
size:
SizeConfig
.
getFontSize
(
24
),
),
SizedBox
(
width:
SizeConfig
.
getPadding
(
10
)),
Text
(
'กล้อง'
,
style:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
18
)),
),
],
),
),
),
Container
(
child:
CupertinoActionSheetAction
(
onPressed:
()
async
{
var
res
=
await
_imagePick
(
ImageSource
.
gallery
);
this
.
callback
(
res
);
},
child:
Row
(
children:
<
Widget
>[
Icon
(
Icons
.
photo
,
color:
Colors
.
black87
,
size:
SizeConfig
.
getFontSize
(
24
),
),
SizedBox
(
width:
SizeConfig
.
getPadding
(
10
)),
Text
(
'รูปภาพ'
,
style:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
18
)),
),
],
),
),
),
],
);
},
);
}
Future
<
File
>
_imagePick
(
ImageSource
source
)
async
{
Navigator
.
pop
(
context
);
var
file
=
await
ImagePicker
.
pickImage
(
source
:
source
);
return
await
_cropImage
(
file
);
}
Future
<
File
>
_cropImage
(
File
file
)
async
{
File
croppedFile
=
await
ImageCropper
.
cropImage
(
sourcePath:
file
.
path
,
aspectRatio:
CropAspectRatio
(
ratioX:
1
,
ratioY:
1
),
androidUiSettings:
AndroidUiSettings
(
toolbarColor:
Theme
.
of
(
context
).
primaryColor
,
toolbarWidgetColor:
Colors
.
white
,
initAspectRatio:
CropAspectRatioPreset
.
original
,
lockAspectRatio:
false
),
iosUiSettings:
IOSUiSettings
(
minimumAspectRatio:
1.0
,
),
);
return
croppedFile
;
}
}
lib/ui/edit_profile/edit_profile.dart
View file @
f29f2aad
import
'dart:io'
;
import
'package:feelverapp/service/image_picker_util.dart'
;
import
'package:feelverapp/ui/edit_profile/editprofile_presenter.dart'
;
import
'package:feelverapp/util/SizeConfig.dart'
;
import
'package:flutter/cupertino.dart'
;
...
...
@@ -11,18 +14,22 @@ class EditProfile extends StatefulWidget {
}
class
_EditProfileState
extends
State
<
EditProfile
>
{
EditprofilePresenter
presenter
;
File
image
;
@override
void
initState
()
{
super
.
initState
();
presenter
=
EditprofilePresenter
(
this
);
presenter
.
getprofile
();
presenter
=
EditprofilePresenter
(
this
);
presenter
.
getprofile
();
}
_getImage
()
{
ImagePickerUtil
(
context
,
(
img
)
{
setState
(()
{
image
=
img
;
});
});
}
@override
...
...
@@ -42,245 +49,294 @@ class _EditProfileState extends State<EditProfile> {
fontWeight:
FontWeight
.
w500
),
),
),
body:
presenter
.
getmodel
==
null
body:
presenter
.
getmodel
==
null
?
Container
(
child:
Center
(
child:
CircularProgressIndicator
(
valueColor:
new
AlwaysStoppedAnimation
<
Color
>(
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),),
)
)):
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
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
(
30
)),
child:
Image
.
asset
(
'assets/images/ic_userimg.png'
,
width:
SizeConfig
.
getWidth
(
100
),
height:
SizeConfig
.
getWidth
(
100
),
valueColor:
new
AlwaysStoppedAnimation
<
Color
>(
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
),
)))
:
SingleChildScrollView
(
child:
Column
(
children:
<
Widget
>[
GestureDetector
(
onTap:
()
{
_getImage
();
},
child:
image
!=
null
?
ClipRRect
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
SizeConfig
.
getWidth
(
56
))),
child:
Image
.
file
(
image
,
fit:
BoxFit
.
contain
,
width:
SizeConfig
.
getWidth
(
100
),
height:
SizeConfig
.
getWidth
(
100
),
),
)
:
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
(
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
(
10
),
top:
SizeConfig
.
getPadding
(
65
)),
child:
Image
.
asset
(
'assets/images/ic_camera_profile.png'
,
width:
SizeConfig
.
getWidth
(
34
),
height:
SizeConfig
.
getWidth
(
34
),
),
)
],
),
),
),
Container
(
alignment:
Alignment
.
topCenter
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
10
),
top:
SizeConfig
.
getPadding
(
65
)),
child:
Image
.
asset
(
'assets/images/ic_camera_profile.png'
,
width:
SizeConfig
.
getWidth
(
34
),
height:
SizeConfig
.
getWidth
(
34
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
controller:
presenter
.
nameCtrl
,
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
),
labelText:
'ชื่อ'
,
hintStyle:
TextStyle
(
fontSize:
15.0
,
color:
Colors
.
black
),
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
),
),
)
],
),
Container
(
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
10
),
top:
SizeConfig
.
getPadding
(
10
),
),
child:
Text
(
"
${presenter.getmodel.result[0].name}
${presenter.getmodel.result[0].lastname}
"
,
style:
TextStyle
(
color:
Color
.
fromRGBO
(
238
,
175
,
183
,
1
),
fontSize:
SizeConfig
.
getFontSize
(
24
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
)
,
labelText:
'ชื่อผู้ใช้งาน'
,
hintText:
"
${presenter.getmodel.result[0].name}
${presenter.getmodel.result[0].lastname}
"
,
hintStyle:
TextStyle
(
fontSize:
15.0
,
color:
Colors
.
black
),
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
),
)
,
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
controller:
presenter
.
lnameCtrl
,
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
),
labelText:
'นามสกุล'
,
hintStyle:
TextStyle
(
fontSize:
15.0
,
color:
Colors
.
black
),
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
),
),
),
hintText:
''
,
labelText:
'เพศ'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextField
(
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
controller:
presenter
.
selectedSex
,
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
),
hintText:
presenter
.
getmodel
.
result
[
0
].
sex
==
'm'
?
"ชาย"
:
"หญิง"
,
labelText:
'เพศ'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
hintText:
''
,
labelText:
'วัน เดือน ปีเกิด'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
controller:
presenter
.
ageCtrl
,
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
),
hintText:
'
${presenter.getmodel.result[0].age}
'
,
labelText:
'อายุ'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
hintText:
''
,
labelText:
'เบอร์โทร'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
controller:
presenter
.
phoneCtrl
,
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
),
hintText:
'
${presenter.getmodel.result[0].phone}
'
,
labelText:
'เบอร์โทร'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
hintText:
''
,
labelText:
'อีเมล์'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
controller:
presenter
.
emailCtrl
,
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
),
hintText:
'
${presenter.getmodel.result[0].email}
'
,
labelText:
'อีเมล์'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
hintText:
''
,
labelText:
'ที่อยู่'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
controller:
presenter
.
addresCtrl
,
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
),
hintText:
'
${presenter.getmodel.result[0].address}
'
,
labelText:
'ที่อยู่'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
hintText:
''
,
labelText:
'ข้อมูลบัญชีธนาคาร'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
left:
SizeConfig
.
getPadding
(
24
),
right:
SizeConfig
.
getPadding
(
24
),
top:
SizeConfig
.
getPadding
(
0
),
),
child:
TextFormField
(
decoration:
InputDecoration
(
focusedBorder:
UnderlineInputBorder
(
borderSide:
BorderSide
(
color:
Colors
.
black45
),
),
hintText:
''
,
labelText:
'ข้อมูลบัญชีธนาคาร'
,
labelStyle:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
SizeConfig
.
getFontSize
(
16
),
fontFamily:
"SF_Pro_Text"
,
fontWeight:
FontWeight
.
w500
),
focusColor:
Colors
.
red
,
),
),
),
SizedBox
(
height:
30
,
),
SizedBox
(
width:
70.0
,
height:
35.0
,
child:
FlatButton
(
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
textColor:
Colors
.
white
,
disabledColor:
Colors
.
grey
,
disabledTextColor:
Colors
.
black
,
padding:
EdgeInsets
.
all
(
0.0
),
splashColor:
Colors
.
blueAccent
,
onPressed:
()
{
print
(
'name=
${presenter.nameCtrl.text}
'
);
print
(
'lastname=
${presenter.lnameCtrl.text}
'
);
print
(
'email=
${presenter.emailCtrl.text}
'
);
print
(
'phone=
${presenter.phoneCtrl.text}
'
);
print
(
'sex=
${presenter.selectedSex.text}
'
);
print
(
'add=
${presenter.addresCtrl.text}
'
);
print
(
'age=
${presenter.ageCtrl.text}
'
);
},
shape:
new
RoundedRectangleBorder
(
borderRadius:
new
BorderRadius
.
circular
(
20.0
)),
child:
Text
(
"ยืนยัน"
,
style:
TextStyle
(
fontSize:
12.0
),
),
))
],
),
),
SizedBox
(
height:
10
,),
SizedBox
(
width:
70.0
,
height:
35.0
,
child:
FlatButton
(
color:
Color
.
fromRGBO
(
106
,
179
,
170
,
1
),
textColor:
Colors
.
white
,
disabledColor:
Colors
.
grey
,
disabledTextColor:
Colors
.
black
,
padding:
EdgeInsets
.
all
(
0.0
),
splashColor:
Colors
.
blueAccent
,
onPressed:
()
{
presenter
.
getprofile
();
},
shape:
new
RoundedRectangleBorder
(
borderRadius:
new
BorderRadius
.
circular
(
20.0
)),
child:
Text
(
"ยืนยัน"
,
style:
TextStyle
(
fontSize:
12.0
),
),
))
],
),
),
);
}
}
lib/ui/edit_profile/editprofile_presenter.dart
View file @
f29f2aad
...
...
@@ -26,9 +26,16 @@ class EditprofilePresenter extends BasePresenter<EditProfile> {
Api
_api
;
final
formKey
=
GlobalKey
<
FormState
>();
TextEditingController
emailCtrl
=
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
();
...
...
@@ -94,6 +101,13 @@ else {
if
(
res
.
fail
==
null
)
{
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
();
});
...
...
pubspec.lock
View file @
f29f2aad
...
...
@@ -76,6 +76,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.8"
flutter_screenutil:
dependency: "direct main"
description:
...
...
@@ -114,6 +121,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
image_cropper:
dependency: "direct main"
description:
name: image_cropper
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.3"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.7+4"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
intl:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
f29f2aad
...
...
@@ -25,6 +25,8 @@ dependencies:
cupertino_icons
:
^0.1.2
flutter_screenutil
:
^1.0.2
http
:
^0.12.0+4
image_cropper
:
^1.2.3
image_picker
:
^0.6.7+4
json_annotation
:
^3.0.1
rflutter_alert
:
^1.0.3
shared_preferences
:
^0.5.6+1
...
...
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