import 'package:farm_tpf/presentation/custom_widgets/app_bar_widget.dart'; import 'package:farm_tpf/presentation/custom_widgets/button_icon_widget.dart'; import 'package:farm_tpf/presentation/screens/profile/sc_change_password.dart'; import 'package:farm_tpf/presentation/screens/profile/sc_update_profile.dart'; import 'package:farm_tpf/utils/const_color.dart'; import 'package:farm_tpf/utils/const_icons.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:package_info/package_info.dart'; class AccountScreen extends StatefulWidget { @override _AccountScreenState createState() => _AccountScreenState(); } class _AccountScreenState extends State { PackageInfo _packageInfo = PackageInfo( version: '1.0.0', buildNumber: '1.', ); Future _initPackageInfo() async { final PackageInfo info = await PackageInfo.fromPlatform(); setState(() { _packageInfo = info; }); } @override void initState() { super.initState(); _initPackageInfo(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBarWidget( isBack: false, ), body: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(8), color: Colors.white, child: Text( 'Cá nhân', style: TextStyle(fontWeight: FontWeight.w500, fontSize: 22), )), Expanded( child: Column(children: [ ButtonIconWidget( title: 'Tài khoản', leadingIcon: AppIcons.icUser, trailingIcon: AppIcons.icArrowRight, isTopBorder: false, onTap: () { Get.to(UpdateProfileScreen()); }), ButtonIconWidget( title: 'Bảo mật', leadingIcon: AppIcons.icSecurity, trailingIcon: AppIcons.icArrowRight, isTopBorder: false, isBottomBorder: false, onTap: () { Get.to(ChangePasswordScreen()); }), Container( width: double.infinity, height: 20, color: Colors.grey[200], ), Container( padding: EdgeInsets.only(left: 12, right: 8, top: 14, bottom: 14), child: Row( children: [ Expanded( child: Text( 'Phiên bản', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w100), )), Text("${_packageInfo.version}.${_packageInfo.buildNumber}") ], ), ), ButtonIconWidget( title: 'Đăng xuất', titleStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w100, color: Colors.red), leadingIcon: AppIcons.icLogout, trailingIcon: AppIcons.icArrowRight, onTap: () {}), ])), ], ), ); } }