| @@ -0,0 +1,3 @@ | |||
| <svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg"> | |||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M0.528575 0.52827C0.788925 0.26792 1.21103 0.26792 1.47138 0.52827L5.47138 4.52827C5.73173 4.78862 5.73173 5.21073 5.47138 5.47108L1.47138 9.47108C1.21103 9.73143 0.788925 9.73143 0.528575 9.47108C0.268226 9.21073 0.268226 8.78862 0.528575 8.52827L4.05717 4.99967L0.528575 1.47108C0.268226 1.21073 0.268226 0.788619 0.528575 0.52827Z" fill="#C4C4C4"/> | |||
| </svg> | |||
| @@ -0,0 +1,5 @@ | |||
| <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> | |||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M3.75 3C3.55109 3 3.36032 3.07902 3.21967 3.21967C3.07902 3.36032 3 3.55109 3 3.75V14.25C3 14.4489 3.07902 14.6397 3.21967 14.7803C3.36032 14.921 3.55109 15 3.75 15H6.75C7.16421 15 7.5 15.3358 7.5 15.75C7.5 16.1642 7.16421 16.5 6.75 16.5H3.75C3.15326 16.5 2.58097 16.2629 2.15901 15.841C1.73705 15.419 1.5 14.8467 1.5 14.25V3.75C1.5 3.15326 1.73705 2.58097 2.15901 2.15901C2.58097 1.73705 3.15326 1.5 3.75 1.5H6.75C7.16421 1.5 7.5 1.83579 7.5 2.25C7.5 2.66421 7.16421 3 6.75 3H3.75Z" fill="#EB5757"/> | |||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M11.4697 4.71967C11.7626 4.42678 12.2374 4.42678 12.5303 4.71967L16.2803 8.46967C16.5732 8.76256 16.5732 9.23744 16.2803 9.53033L12.5303 13.2803C12.2374 13.5732 11.7626 13.5732 11.4697 13.2803C11.1768 12.9874 11.1768 12.5126 11.4697 12.2197L14.6893 9L11.4697 5.78033C11.1768 5.48744 11.1768 5.01256 11.4697 4.71967Z" fill="#EB5757"/> | |||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M6 9C6 8.58579 6.33579 8.25 6.75 8.25H15.75C16.1642 8.25 16.5 8.58579 16.5 9C16.5 9.41421 16.1642 9.75 15.75 9.75H6.75C6.33579 9.75 6 9.41421 6 9Z" fill="#EB5757"/> | |||
| </svg> | |||
| @@ -0,0 +1,3 @@ | |||
| <svg width="16" height="18" viewBox="0 0 16 18" fill="none" xmlns="http://www.w3.org/2000/svg"> | |||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M7.68789 0.0520947C7.88912 -0.0173649 8.11088 -0.0173649 8.31211 0.0520947L15.4232 2.50666C15.7702 2.62641 16 2.93169 16 3.27275V9.00006C16 11.8199 13.9718 14.0731 12.1409 15.5477C11.2068 16.3 10.2769 16.8881 9.58222 17.2877C9.23398 17.488 8.94251 17.6424 8.73606 17.7476C8.63278 17.8002 8.5506 17.8406 8.49305 17.8684C8.46426 17.8823 8.44162 17.8931 8.42556 17.9007L8.40645 17.9096L8.40069 17.9123L8.39878 17.9132C8.3985 17.9133 8.39752 17.9137 8 17.1819C7.60248 17.9137 7.60222 17.9136 7.60193 17.9135L7.59931 17.9123L7.59355 17.9096L7.57444 17.9007C7.55838 17.8931 7.53574 17.8823 7.50695 17.8684C7.4494 17.8406 7.36722 17.8002 7.26394 17.7476C7.05749 17.6424 6.76602 17.488 6.41778 17.2877C5.72315 16.8881 4.79323 16.3 3.85911 15.5477C2.02822 14.0731 0 11.8199 0 9.00006V3.27275C0 2.93169 0.229842 2.62641 0.576779 2.50666L7.68789 0.0520947ZM8 17.1819L7.60193 17.9135C7.85218 18.0287 8.14728 18.0289 8.39752 17.9137L8 17.1819ZM8 16.2515C8.17034 16.1626 8.38818 16.0449 8.64 15.9C9.2787 15.5326 10.1266 14.9957 10.9702 14.3162C12.6949 12.9271 14.2222 11.0894 14.2222 9.00006V3.83975L8 1.69201L1.77778 3.83975V9.00006C1.77778 11.0894 3.30511 12.9271 5.02978 14.3162C5.87344 14.9957 6.7213 15.5326 7.36 15.9C7.61182 16.0449 7.82965 16.1626 8 16.2515Z" fill="#EECE52"/> | |||
| </svg> | |||
| @@ -0,0 +1,4 @@ | |||
| <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> | |||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M3.34835 11.5984C4.05161 10.8951 5.00544 10.5 6 10.5H12C12.9946 10.5 13.9484 10.8951 14.6517 11.5984C15.3549 12.3016 15.75 13.2554 15.75 14.25V15.75C15.75 16.1642 15.4142 16.5 15 16.5C14.5858 16.5 14.25 16.1642 14.25 15.75V14.25C14.25 13.6533 14.0129 13.081 13.591 12.659C13.169 12.2371 12.5967 12 12 12H6C5.40326 12 4.83097 12.2371 4.40901 12.659C3.98705 13.081 3.75 13.6533 3.75 14.25V15.75C3.75 16.1642 3.41421 16.5 3 16.5C2.58579 16.5 2.25 16.1642 2.25 15.75V14.25C2.25 13.2554 2.64509 12.3016 3.34835 11.5984Z" fill="#EECE52"/> | |||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M9 3C7.75736 3 6.75 4.00736 6.75 5.25C6.75 6.49264 7.75736 7.5 9 7.5C10.2426 7.5 11.25 6.49264 11.25 5.25C11.25 4.00736 10.2426 3 9 3ZM5.25 5.25C5.25 3.17893 6.92893 1.5 9 1.5C11.0711 1.5 12.75 3.17893 12.75 5.25C12.75 7.32107 11.0711 9 9 9C6.92893 9 5.25 7.32107 5.25 5.25Z" fill="#EECE52"/> | |||
| </svg> | |||
| @@ -0,0 +1,77 @@ | |||
| import 'package:farm_tpf/utils/const_color.dart'; | |||
| import 'package:flutter/material.dart'; | |||
| import 'package:flutter_svg/flutter_svg.dart'; | |||
| class ButtonIconWidget extends StatelessWidget { | |||
| final String title; | |||
| final TextStyle titleStyle; | |||
| final String subTitle; | |||
| final Function onTap; | |||
| final String leadingIcon; | |||
| final String trailingIcon; | |||
| final bool isTopBorder; | |||
| final bool isBottomBorder; | |||
| ButtonIconWidget( | |||
| {@required this.title, | |||
| @required this.onTap, | |||
| this.titleStyle, | |||
| this.subTitle, | |||
| this.leadingIcon, | |||
| this.trailingIcon, | |||
| this.isBottomBorder = true, | |||
| this.isTopBorder = true}); | |||
| @override | |||
| Widget build(BuildContext context) { | |||
| return SizedBox( | |||
| width: double.infinity, | |||
| child: MaterialButton( | |||
| padding: EdgeInsets.all(0), | |||
| onPressed: onTap, | |||
| child: Container( | |||
| padding: EdgeInsets.all(12), | |||
| decoration: BoxDecoration( | |||
| border: Border( | |||
| top: isTopBorder | |||
| ? BorderSide(color: AppColors.GRAY1, width: 0.35) | |||
| : BorderSide.none, | |||
| bottom: isBottomBorder | |||
| ? BorderSide(color: AppColors.GRAY1, width: 0.35) | |||
| : BorderSide.none)), | |||
| width: double.infinity, | |||
| child: Row( | |||
| mainAxisSize: MainAxisSize.max, | |||
| children: [ | |||
| leadingIcon == null | |||
| ? SizedBox() | |||
| : SizedBox( | |||
| width: 20, | |||
| height: 20, | |||
| child: SvgPicture.asset(leadingIcon)), | |||
| SizedBox(width: 4), | |||
| Expanded( | |||
| child: Column( | |||
| crossAxisAlignment: CrossAxisAlignment.start, | |||
| mainAxisSize: MainAxisSize.min, | |||
| children: [ | |||
| Text( | |||
| title, | |||
| style: titleStyle ?? | |||
| TextStyle(fontSize: 16, fontWeight: FontWeight.w100), | |||
| ), | |||
| subTitle == null | |||
| ? SizedBox() | |||
| : Text( | |||
| subTitle, | |||
| style: TextStyle(fontSize: 14), | |||
| ) | |||
| ], | |||
| ), | |||
| ), | |||
| trailingIcon == null ? SizedBox() : SvgPicture.asset(trailingIcon) | |||
| ], | |||
| ), | |||
| ), | |||
| ), | |||
| ); | |||
| } | |||
| } | |||
| @@ -0,0 +1,100 @@ | |||
| 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_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<AccountScreen> { | |||
| PackageInfo _packageInfo = PackageInfo( | |||
| version: '1.0.0', | |||
| buildNumber: '1.', | |||
| ); | |||
| Future<void> _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: <Widget>[ | |||
| 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: () {}), | |||
| 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: () {}), | |||
| ])), | |||
| ], | |||
| ), | |||
| ); | |||
| } | |||
| } | |||
| @@ -42,23 +42,10 @@ class _UpdateProfileScreenState extends State<UpdateProfileScreen> { | |||
| TextEditingController _addressController = TextEditingController(); | |||
| var checkChangeLocation = Get.put(CheckChangeAnotherDropdown()); | |||
| PackageInfo _packageInfo = PackageInfo( | |||
| version: '1.0.0', | |||
| buildNumber: '1.', | |||
| ); | |||
| Future<void> _initPackageInfo() async { | |||
| final PackageInfo info = await PackageInfo.fromPlatform(); | |||
| setState(() { | |||
| _packageInfo = info; | |||
| }); | |||
| } | |||
| @override | |||
| void initState() { | |||
| super.initState(); | |||
| checkChangeLocation.initValue(); | |||
| _initPackageInfo(); | |||
| getAccountBloc.getAccount((data) { | |||
| _account = data; | |||
| _userNameController.text = _account.login; | |||
| @@ -382,15 +369,6 @@ class _UpdateProfileScreenState extends State<UpdateProfileScreen> { | |||
| ))); | |||
| } | |||
| Widget _textPackageInfo() { | |||
| return Container( | |||
| width: double.infinity, | |||
| alignment: Alignment.centerRight, | |||
| child: Text( | |||
| "version:${_packageInfo.version}.${_packageInfo.buildNumber}", | |||
| style: TextStyle(color: AppColors.GRAY1_70))); | |||
| } | |||
| @override | |||
| Widget build(BuildContext context) => KeyboardDismisser( | |||
| child: Scaffold( | |||
| @@ -483,10 +461,6 @@ class _UpdateProfileScreenState extends State<UpdateProfileScreen> { | |||
| height: 16.0, | |||
| ), | |||
| _btnChangePassword(), | |||
| SizedBox( | |||
| height: 8, | |||
| ), | |||
| _textPackageInfo() | |||
| ], | |||
| ), | |||
| )); | |||
| @@ -1,4 +1,5 @@ | |||
| import 'package:farm_tpf/main.dart'; | |||
| import 'package:farm_tpf/presentation/screens/account/sc_account.dart'; | |||
| import 'package:farm_tpf/presentation/screens/control_device/sc_control_device.dart'; | |||
| import 'package:farm_tpf/presentation/screens/notification/sc_notification.dart'; | |||
| import 'package:farm_tpf/presentation/screens/plot/sc_plot.dart'; | |||
| @@ -64,7 +65,7 @@ class _TabbarScreenState extends State<TabbarScreen> { | |||
| return NotificationScreen(); | |||
| break; | |||
| case TabBarIndex.account: | |||
| return UpdateProfileScreen(); | |||
| return AccountScreen(); | |||
| break; | |||
| default: | |||
| return PlotListScreen(); | |||
| @@ -8,4 +8,8 @@ class AppIcons { | |||
| static const icQr = baseAssets + 'ic_qr.svg'; | |||
| static const icPerson = baseAssets + 'ic_person.svg'; | |||
| static const icNotificationItem = baseAssets + 'ic_notification_item.svg'; | |||
| static const icUser = baseAssets + 'ic_user.svg'; | |||
| static const icSecurity = baseAssets + 'ic_security.svg'; | |||
| static const icArrowRight = baseAssets + 'ic_arrow_right.svg'; | |||
| static const icLogout = baseAssets + 'ic_logout.svg'; | |||
| } | |||