Created
April 1, 2019 23:38
-
-
Save a7me63azzab/30e3681f88692ae66c6be9040957de23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import '../widgets/Circle_image.dart'; | |
import '../helpers/color.dart'; | |
import '../helpers/Utils.dart'; | |
class EditProfilePage extends StatefulWidget { | |
@override | |
State<StatefulWidget> createState() { | |
return _EditProfilePageState(); | |
} | |
} | |
class _EditProfilePageState extends State<EditProfilePage> { | |
final GlobalKey<FormState> _formKey = new GlobalKey<FormState>(); | |
@override | |
Widget build(BuildContext context) { | |
Locale myLocale = Localizations.localeOf(context); | |
return CupertinoPageScaffold( | |
backgroundColor: Colors.white, | |
navigationBar: CupertinoNavigationBar( | |
previousPageTitle: "Back", | |
middle: Text( | |
myLocale.languageCode.contains("en") | |
? "Edit Profile" | |
: "تعديل الملف الشخصى", | |
style: new TextStyle( | |
fontSize: 18, | |
color: Colors.black, | |
fontFamily: myLocale.languageCode.contains("en") | |
? 'Poppins' | |
: 'DIN Next LT Arabic', | |
fontWeight: FontWeight.bold, | |
), | |
), | |
backgroundColor: Utils.appbarColor, | |
), | |
child: Container( | |
width: double.infinity, | |
height: double.infinity, | |
padding: EdgeInsets.all(10), | |
child: SingleChildScrollView( | |
child: Form( | |
key: _formKey, | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.start, | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: <Widget>[ | |
CircleImage("https://i.imgur.com/8Y3SdQZ.png"), | |
CupertinoButton( | |
padding: EdgeInsets.all(4), | |
child: Text( | |
"Change Photo", | |
style: new TextStyle( | |
fontWeight: FontWeight.bold, | |
), | |
), | |
onPressed: () {}, | |
), | |
Row( | |
children: <Widget>[ | |
Expanded( | |
child: CupertinoTextField( | |
padding: EdgeInsets.all(15), | |
keyboardType: TextInputType.text, | |
placeholder: "First name", | |
prefix: Padding( | |
padding: EdgeInsets.only(left: 5), | |
child: Icon( | |
Icons.person, | |
color: Color(getColorHexFromStr("#444444")), | |
), | |
), | |
decoration: BoxDecoration( | |
color: CupertinoColors.lightBackgroundGray, | |
borderRadius: BorderRadius.only( | |
bottomLeft: Radius.circular(10), | |
topLeft: Radius.circular(10)), | |
), | |
), | |
), | |
VerticalDivider( | |
width: 1.0, | |
color: Colors.black, | |
), | |
Expanded( | |
child: CupertinoTextField( | |
padding: EdgeInsets.all(15), | |
keyboardType: TextInputType.text, | |
placeholder: "Last name", | |
decoration: BoxDecoration( | |
color: CupertinoColors.lightBackgroundGray, | |
borderRadius: BorderRadius.only( | |
bottomRight: Radius.circular(10), | |
topRight: Radius.circular(10)), | |
), | |
), | |
), | |
], | |
), | |
SizedBox( | |
height: 10, | |
), | |
CupertinoTextField( | |
padding: EdgeInsets.all(15), | |
keyboardType: TextInputType.datetime, | |
placeholder: "Date of birth", | |
prefix: Padding( | |
padding: EdgeInsets.only(left: 5), | |
child: Icon( | |
Icons.date_range, | |
color: Color(getColorHexFromStr("#444444")), | |
), | |
), | |
decoration: BoxDecoration( | |
color: CupertinoColors.lightBackgroundGray, | |
borderRadius: BorderRadius.circular(10), | |
), | |
), | |
SizedBox( | |
height: 10, | |
), | |
CupertinoTextField( | |
padding: EdgeInsets.all(15), | |
keyboardType: TextInputType.text, | |
placeholder: "Nationality", | |
prefix: Padding( | |
padding: EdgeInsets.only(left: 5), | |
child: Icon( | |
Icons.public, | |
color: Color(getColorHexFromStr("#444444")), | |
), | |
), | |
decoration: BoxDecoration( | |
color: CupertinoColors.lightBackgroundGray, | |
borderRadius: BorderRadius.circular(10), | |
), | |
), | |
SizedBox( | |
height: 10, | |
), | |
CupertinoTextField( | |
padding: EdgeInsets.all(15), | |
keyboardType: TextInputType.text, | |
placeholder: "Country of residence", | |
prefix: Padding( | |
padding: EdgeInsets.only(left: 5), | |
child: Icon( | |
Icons.place, | |
color: Color(getColorHexFromStr("#444444")), | |
), | |
), | |
decoration: BoxDecoration( | |
color: CupertinoColors.lightBackgroundGray, | |
borderRadius: BorderRadius.circular(10), | |
), | |
), | |
SizedBox( | |
height: 10, | |
), | |
CupertinoTextField( | |
padding: EdgeInsets.all(15), | |
keyboardType: TextInputType.text, | |
placeholder: "Job", | |
prefix: Padding( | |
padding: EdgeInsets.only(left: 5), | |
child: Icon( | |
Icons.work, | |
color: Color(getColorHexFromStr("#444444")), | |
), | |
), | |
decoration: BoxDecoration( | |
color: CupertinoColors.lightBackgroundGray, | |
borderRadius: BorderRadius.circular(10), | |
), | |
), | |
SizedBox( | |
height: 10, | |
), | |
CupertinoTextField( | |
padding: EdgeInsets.all(15), | |
keyboardType: TextInputType.emailAddress, | |
placeholder: "Email", | |
prefix: Padding( | |
padding: EdgeInsets.only(left: 5), | |
child: Icon( | |
Icons.local_post_office, | |
color: Color(getColorHexFromStr("#444444")), | |
), | |
), | |
decoration: BoxDecoration( | |
color: CupertinoColors.lightBackgroundGray, | |
borderRadius: BorderRadius.circular(10), | |
), | |
), | |
SizedBox( | |
height: 10, | |
), | |
CupertinoTextField( | |
padding: EdgeInsets.all(15), | |
keyboardType: TextInputType.text, | |
placeholder: "Languages", | |
prefix: Padding( | |
padding: EdgeInsets.only(left: 5), | |
child: Icon( | |
Icons.g_translate, | |
color: Color(getColorHexFromStr("#444444")), | |
), | |
), | |
decoration: BoxDecoration( | |
color: CupertinoColors.lightBackgroundGray, | |
borderRadius: BorderRadius.circular(10), | |
), | |
), | |
SizedBox( | |
height: 10, | |
), | |
Container( | |
width: double.infinity, | |
height: 90, | |
decoration: BoxDecoration( | |
color: CupertinoColors.lightBackgroundGray, | |
borderRadius: BorderRadius.circular(10), | |
), | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceAround, | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: <Widget>[ | |
CupertinoButton( | |
onPressed: null, | |
child: Text( | |
"ID Photo", | |
style: TextStyle( | |
fontWeight: FontWeight.bold, | |
color: Color(getColorHexFromStr("#444444")), | |
fontSize: 25), | |
), | |
), | |
Image.asset( | |
"assets/icons/id-card.png", | |
color: Color(getColorHexFromStr("#444444")), | |
), | |
], | |
), | |
), | |
SizedBox( | |
height: 20, | |
), | |
CupertinoButton.filled( | |
onPressed: () {}, | |
child: Text( | |
"Update", | |
style: TextStyle( | |
fontWeight: FontWeight.bold, | |
fontSize: 25, | |
), | |
), | |
), | |
SizedBox( | |
height: 10, | |
), | |
], | |
), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment