Files
fcs/lib/pages/user_edit.dart

114 lines
3.1 KiB
Dart
Raw Normal View History

2020-05-31 15:00:11 +06:30
import 'package:fcs/model/shared_pref.dart';
2020-06-01 14:24:45 +06:30
import 'package:fcs/widget/localization/app_translations.dart';
2020-05-29 16:14:17 +06:30
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../theme/theme.dart';
import '../widget/local_text.dart';
import '../widget/progress.dart';
class UserEditPage extends StatefulWidget {
@override
_UserEditPageState createState() => _UserEditPageState();
}
class _UserEditPageState extends State<UserEditPage> {
bool _isLoading = false;
TextEditingController nameCtl;
@override
void initState() {
super.initState();
nameCtl = new TextEditingController();
}
@override
Widget build(BuildContext context) {
return LocalProgress(
inAsyncCall: _isLoading,
child: new Scaffold(
appBar: AppBar(
2020-06-01 14:24:45 +06:30
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
2020-05-29 16:14:17 +06:30
backgroundColor: primaryColor,
),
body: _buildBody(context),
),
);
}
Widget _buildBody(BuildContext context) {
return ListView(
2020-06-01 14:24:45 +06:30
padding: EdgeInsets.only(top: 5, left: 10, right: 10),
2020-05-29 16:14:17 +06:30
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 40),
child: LocalText(
context,
'user_edit.welcome',
fontSize: 21,
2020-06-01 14:24:45 +06:30
color: primaryColor,
2020-05-29 16:14:17 +06:30
fontWeight: FontWeight.bold,
),
),
Container(
padding: EdgeInsets.only(top: 25),
child: LocalText(
context,
'user_edit.name',
color: labelColor,
fontSize: 16,
),
),
Container(
2020-06-01 14:24:45 +06:30
padding: EdgeInsets.only(top: 0, bottom: 10),
2020-05-29 16:14:17 +06:30
child: TextFormField(
controller: nameCtl,
cursorColor: primaryColor,
textAlign: TextAlign.left,
2020-06-01 14:24:45 +06:30
keyboardType: TextInputType.text,
autofocus: true,
2020-05-29 16:14:17 +06:30
style: TextStyle(
fontSize: 18,
),
2020-06-01 14:24:45 +06:30
decoration: new InputDecoration(
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: primaryColor, width: 1.0)),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: primaryColor, width: 1.0)),
2020-05-29 16:14:17 +06:30
),
)),
SizedBox(
height: 20,
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
InkWell(
onTap: () => _submit(),
child: CircleAvatar(
minRadius: 25,
backgroundColor: primaryColor,
child: Icon(
FontAwesomeIcons.check,
color: Colors.white,
),
),
)
],
),
),
],
);
}
2020-05-31 15:00:11 +06:30
_submit() async {
Navigator.pop(context);
}
2020-05-29 16:14:17 +06:30
}