Browse Source

update ui main tabbar screen

master
daivph 5 years ago
parent
commit
2ca0a6dfb5
4 changed files with 123 additions and 113 deletions
  1. +64
    -60
      lib/presentation/screens/account/sc_account.dart
  2. +52
    -50
      lib/presentation/screens/control_device/sc_control_device.dart
  3. +4
    -2
      lib/presentation/screens/notification/sc_notification.dart
  4. +3
    -1
      lib/presentation/screens/plot/sc_plot.dart

+ 64
- 60
lib/presentation/screens/account/sc_account.dart View File

@@ -63,69 +63,73 @@ class _AccountScreenState extends State<AccountScreen> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 8,
),
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],
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 8,
),
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}")
],
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],
),
),
ButtonIconWidget(
title: 'Đăng xuất',
titleStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w100,
color: Colors.red),
leadingIcon: AppIcons.icLogout,
trailingIcon: AppIcons.icArrowRight,
onTap: () {
_clickSignOut();
}),
])),
],
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: () {
_clickSignOut();
}),
])),
],
),
),
);
}

+ 52
- 50
lib/presentation/screens/control_device/sc_control_device.dart View File

@@ -33,59 +33,61 @@ class _ControlDeviceScreenState extends State<ControlDeviceScreen> {
}

Widget _buildContent() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Thiết bị',
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 22),
return SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Điều khiển thiết bị từ xa',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w200,
color: Colors.black54)),
),
SearchWidget(searchPressed: (value) {
FocusScope.of(context).requestFocus(FocusNode());
_deviceBloc.add(OnSearch(query: value));
}),
Expanded(
child: BlocBuilder<DeviceBloc, DeviceState>(
cubit: _deviceBloc,
builder: (context, state) {
if (state is DisplayDevice) {
if (state.loading) {
return Container(
child: Center(
child: CircularProgressIndicator(),
),
);
}
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Thiết bị',
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 22),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Điều khiển thiết bị từ xa',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w200,
color: Colors.black54)),
),
SearchWidget(searchPressed: (value) {
FocusScope.of(context).requestFocus(FocusNode());
_deviceBloc.add(OnSearch(query: value));
}),
Expanded(
child: BlocBuilder<DeviceBloc, DeviceState>(
cubit: _deviceBloc,
builder: (context, state) {
if (state is DisplayDevice) {
if (state.loading) {
return Container(
child: Center(
child: CircularProgressIndicator(),
),
);
}

if (state.devices != null) {
return Container(
child: WidgetDeviceList(
devices: state.devices,
deviceBloc: _deviceBloc,
),
);
if (state.devices != null) {
return Container(
child: WidgetDeviceList(
devices: state.devices,
deviceBloc: _deviceBloc,
),
);
}
return Container();
} else {
return Container();
}
return Container();
} else {
return Container();
}
},
))
],
},
))
],
),
);
}
}

+ 4
- 2
lib/presentation/screens/notification/sc_notification.dart View File

@@ -64,8 +64,10 @@ class HoldInfinityWidget extends StatelessWidget {
body: BlocBuilder<NotiBloc, NotiState>(
cubit: notiBloc,
builder: (context, state) {
return InfinityView(
notiBloc: notiBloc,
return SafeArea(
child: InfinityView(
notiBloc: notiBloc,
),
);
},
));

+ 3
- 1
lib/presentation/screens/plot/sc_plot.dart View File

@@ -147,7 +147,9 @@ class HoldInfinityWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white, key: _scaffoldKey, body: InfinityView());
backgroundColor: Colors.white,
key: _scaffoldKey,
body: SafeArea(child: InfinityView()));
}
}


Loading…
Cancel
Save