import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:fcs/model/main_model.dart'; import 'package:fcs/widget/local_text.dart'; import 'package:fcs/widget/progress.dart'; import '../theme/theme.dart'; import 'add_pin_editor.dart'; import 'block_list.dart'; import 'chage_phone_number.dart'; import 'change_password.dart'; import 'device_list.dart'; import 'email_page.dart'; import 'log_list.dart'; class ProfileSetting extends StatefulWidget { @override _ProfileSettingtate createState() => _ProfileSettingtate(); } class _ProfileSettingtate extends State { bool _isLoading = false; @override Widget build(BuildContext context) { MainModel mainModel = Provider.of(context); return LocalProgress( inAsyncCall: _isLoading, child: Scaffold( appBar: AppBar( title: LocalText( context, "setting.title", fontSize: 20, color: Colors.white, ), backgroundColor: primaryColor, ), body: SingleChildScrollView( padding: EdgeInsets.only( left: 25.0, right: 25.0, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( height: 8, ), buildSettingTile( context: context, text: 'log.title', image: "assets/message.png", width: 25, height: 25, tap: () { Navigator.push(context, MaterialPageRoute(builder: (context) => LogList())); }, ), buildSettingTile( context: context, text: 'profile.devices', image: "assets/device.png", width: 29, height: 29, tap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => PhoneDeviceList())); }, ), buildSettingTile( context: context, text: 'change.password.title', image: "assets/password.png", width: 27, height: 27, tap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => ChangePassword(mainModel.user))); }, ), buildSettingTile( context: context, text: 'change.phone', image: "assets/phone.png", width: 30, height: 25, tap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => ChangePhoneNumber(mainModel.user))); }, ), buildSettingTile( context: context, text: 'change.email', image: "assets/email.png", width: 25, height: 25, tap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => EmailPage( user: mainModel.user, ))); }, ), // buildSettingTile( // context: context, // text: 'user.block_list', // image: "assets/block.png", // width: 27, // height: 27, // tap: () { // Navigator.push(context, // MaterialPageRoute(builder: (context) => BlockList())); // }, // ), buildSettingTile( context: context, text: 'change.pin.title', image: "assets/pin.png", width: 30, height: 30, tap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => AddPINEditor( mainModel.user, ))); }, ), ], ), ), ), ); } } Widget buildSettingTile( {@required String text, @required BuildContext context, @required String image, @required double width, @required double height, @required GestureTapCallback tap}) { return InkWell( onTap: () { tap(); }, child: Column( children: [ Padding( padding: EdgeInsets.only(top: 8.0, bottom: 5), child: Row( children: [ Expanded( child: Row( children: [ Padding( padding: EdgeInsets.only(left: 12.0, right: 20.0), child: Image.asset( image, width: width, height: height, color: primaryColor, ), ), LocalText( context, text, fontSize: 15.0, color: Colors.black87, ) ], ), ), Icon(Icons.keyboard_arrow_right) ], ), ), Divider( color: Colors.grey, ) ], ), ); }