| @@ -33,18 +33,6 @@ class _SearchWidgetState extends State<SearchWidget> { | |||
| child: Padding( | |||
| padding: const EdgeInsets.only(right: 8, top: 8, bottom: 0), | |||
| child: Container( | |||
| decoration: BoxDecoration( | |||
| color: Colors.white, | |||
| borderRadius: const BorderRadius.all( | |||
| Radius.circular(38.0), | |||
| ), | |||
| boxShadow: <BoxShadow>[ | |||
| BoxShadow( | |||
| color: Colors.grey.withOpacity(0.2), | |||
| offset: const Offset(0, 2), | |||
| blurRadius: 8.0), | |||
| ], | |||
| ), | |||
| child: Padding( | |||
| padding: const EdgeInsets.only( | |||
| left: 16, right: 16, top: 4, bottom: 4), | |||
| @@ -54,8 +42,12 @@ class _SearchWidgetState extends State<SearchWidget> { | |||
| onChanged: (String txt) {}, | |||
| cursorColor: AppColors.GRAY1, | |||
| decoration: InputDecoration( | |||
| border: InputBorder.none, | |||
| hintText: 'Tìm kiếm ...', | |||
| suffixIcon: Icon( | |||
| Icons.search, | |||
| size: 30, | |||
| ), | |||
| hintText: 'Tìm thiết bị', | |||
| hintStyle: TextStyle(color: Colors.grey[500]), | |||
| ), | |||
| onSubmitted: widget.searchPressed, | |||
| ), | |||
| @@ -1,4 +1,5 @@ | |||
| import 'package:farm_tpf/data/repository/repository.dart'; | |||
| import 'package:farm_tpf/presentation/custom_widgets/app_bar_widget.dart'; | |||
| import 'package:farm_tpf/presentation/custom_widgets/widget_search.dart'; | |||
| import 'package:farm_tpf/presentation/screens/control_device/widget_device_list.dart'; | |||
| import 'package:flutter/material.dart'; | |||
| @@ -24,9 +25,9 @@ class _ControlDeviceScreenState extends State<ControlDeviceScreen> { | |||
| Widget build(BuildContext context) { | |||
| _blocContext = context; | |||
| return Scaffold( | |||
| appBar: AppBar( | |||
| centerTitle: true, | |||
| title: Text("Điều khiển thiết bị"), | |||
| backgroundColor: Colors.white, | |||
| appBar: AppBarWidget( | |||
| isBack: false, | |||
| ), | |||
| body: BlocProvider<DeviceBloc>( | |||
| create: (context) => | |||
| @@ -36,7 +37,23 @@ class _ControlDeviceScreenState extends State<ControlDeviceScreen> { | |||
| Widget _buildContent() { | |||
| return Column( | |||
| crossAxisAlignment: CrossAxisAlignment.start, | |||
| children: [ | |||
| 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)); | |||
| @@ -78,16 +78,21 @@ class _WidgetDeviceListState extends State<WidgetDeviceList> { | |||
| onTap: () { | |||
| //Navigator.of(context).push(MaterialPageRoute(builder: (context) => DeviceDetail(device: _device,))); | |||
| }, | |||
| child: Card( | |||
| child: Container( | |||
| decoration: BoxDecoration( | |||
| border: | |||
| Border(bottom: BorderSide(color: Colors.grey, width: 0.35))), | |||
| child: ListTile( | |||
| leading: powerBtn(item, context), | |||
| title: Text( | |||
| '${item.name} - ${item.location ?? ''}', | |||
| style: TextStyle( | |||
| color: Colors.black54, fontSize: 13, fontWeight: FontWeight.bold), | |||
| ), | |||
| subtitle: widgetStatus(item), | |||
| )), | |||
| title: Text( | |||
| '${item.name} - ${item.location ?? ''}', | |||
| style: TextStyle( | |||
| color: Colors.black54, | |||
| fontSize: 15, | |||
| fontWeight: FontWeight.bold), | |||
| ), | |||
| subtitle: widgetStatus(item), | |||
| trailing: powerBtn(item, context), | |||
| )), | |||
| ); | |||
| } | |||