import 'package:fcs/model/shared_pref.dart'; import 'package:fcs/widget/localization/app_translations.dart'; 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 { 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( centerTitle: true, leading: new IconButton( icon: new Icon(Icons.close), onPressed: () => Navigator.of(context).pop(), ), backgroundColor: primaryColor, ), body: _buildBody(context), ), ); } Widget _buildBody(BuildContext context) { return ListView( padding: EdgeInsets.only(top: 5, left: 10, right: 10), children: [ Container( padding: EdgeInsets.only(top: 40), child: LocalText( context, 'user_edit.welcome', fontSize: 21, color: primaryColor, fontWeight: FontWeight.bold, ), ), Container( padding: EdgeInsets.only(top: 25), child: LocalText( context, 'user_edit.name', color: labelColor, fontSize: 16, ), ), Container( padding: EdgeInsets.only(top: 0, bottom: 10), child: TextFormField( controller: nameCtl, cursorColor: primaryColor, textAlign: TextAlign.left, keyboardType: TextInputType.text, autofocus: true, style: TextStyle( fontSize: 18, ), decoration: new InputDecoration( enabledBorder: UnderlineInputBorder( borderSide: BorderSide(color: primaryColor, width: 1.0)), focusedBorder: UnderlineInputBorder( borderSide: BorderSide(color: primaryColor, width: 1.0)), ), )), SizedBox( height: 20, ), Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ InkWell( onTap: () => _submit(), child: CircleAvatar( minRadius: 25, backgroundColor: primaryColor, child: Icon( FontAwesomeIcons.check, color: Colors.white, ), ), ) ], ), ), ], ); } _submit() async { Navigator.pop(context); } }