| dab672e712362fdbbfa98386624f95d6 | |||||
| 440505e9ea1eee7043d2cbfeb318f6bc |
| Widget getSearchBarUI() { | Widget getSearchBarUI() { | ||||
| _searchController.text = ""; | _searchController.text = ""; | ||||
| return Padding( | return Padding( | ||||
| padding: const EdgeInsets.only(left: 8, right: 8, top: 4, bottom: 4), | |||||
| padding: const EdgeInsets.only(left: 8, right: 8, top: 0, bottom: 4), | |||||
| child: Row( | child: Row( | ||||
| children: <Widget>[ | children: <Widget>[ | ||||
| Expanded( | Expanded( | ||||
| child: Padding( | child: Padding( | ||||
| padding: const EdgeInsets.only(right: 8, top: 8, bottom: 0), | |||||
| padding: const EdgeInsets.only(right: 8, top: 0, bottom: 0), | |||||
| child: Container( | child: Container( | ||||
| child: Padding( | child: Padding( | ||||
| padding: const EdgeInsets.only( | padding: const EdgeInsets.only( |
| Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
| return Scaffold( | return Scaffold( | ||||
| backgroundColor: Colors.white, | backgroundColor: Colors.white, | ||||
| appBar: AppBarWidget( | |||||
| isBack: false, | |||||
| ), | |||||
| body: Column( | body: Column( | ||||
| crossAxisAlignment: CrossAxisAlignment.start, | crossAxisAlignment: CrossAxisAlignment.start, | ||||
| children: <Widget>[ | children: <Widget>[ | ||||
| SizedBox( | |||||
| height: 8, | |||||
| ), | |||||
| Container( | Container( | ||||
| padding: EdgeInsets.all(8), | padding: EdgeInsets.all(8), | ||||
| color: Colors.white, | color: Colors.white, |
| _blocContext = context; | _blocContext = context; | ||||
| return Scaffold( | return Scaffold( | ||||
| backgroundColor: Colors.white, | backgroundColor: Colors.white, | ||||
| appBar: AppBarWidget( | |||||
| isBack: false, | |||||
| ), | |||||
| body: BlocProvider<DeviceBloc>( | body: BlocProvider<DeviceBloc>( | ||||
| create: (context) => | create: (context) => | ||||
| DeviceBloc(repository: Repository())..add(OpenScreen()), | DeviceBloc(repository: Repository())..add(OpenScreen()), | ||||
| return Column( | return Column( | ||||
| crossAxisAlignment: CrossAxisAlignment.start, | crossAxisAlignment: CrossAxisAlignment.start, | ||||
| children: [ | children: [ | ||||
| SizedBox( | |||||
| height: 8, | |||||
| ), | |||||
| Padding( | Padding( | ||||
| padding: const EdgeInsets.all(8.0), | padding: const EdgeInsets.all(8.0), | ||||
| child: Text( | child: Text( |
| return Scaffold( | return Scaffold( | ||||
| key: _scaffoldKey, | key: _scaffoldKey, | ||||
| backgroundColor: Colors.white, | backgroundColor: Colors.white, | ||||
| appBar: AppBarWidget( | |||||
| isBack: false, | |||||
| ), | |||||
| body: BlocBuilder<NotiBloc, NotiState>( | body: BlocBuilder<NotiBloc, NotiState>( | ||||
| cubit: notiBloc, | cubit: notiBloc, | ||||
| builder: (context, state) { | builder: (context, state) { | ||||
| return Center(child: Text(state.errorString)); | return Center(child: Text(state.errorString)); | ||||
| } else if (state is NotiSuccess) { | } else if (state is NotiSuccess) { | ||||
| if (state.items.isEmpty) { | if (state.items.isEmpty) { | ||||
| return Center(child: Text("Không có thông báo")); | |||||
| return Column( | |||||
| crossAxisAlignment: CrossAxisAlignment.start, | |||||
| children: [ | |||||
| SizedBox( | |||||
| height: 8, | |||||
| ), | |||||
| Padding( | |||||
| padding: const EdgeInsets.all(8.0), | |||||
| child: Text('Thông báo', | |||||
| style: | |||||
| TextStyle(fontWeight: FontWeight.w500, fontSize: 22)), | |||||
| ), | |||||
| Expanded( | |||||
| child: Center(child: Text("Không có thông báo")), | |||||
| ), | |||||
| ], | |||||
| ); | |||||
| } | } | ||||
| currentItems = List<NotificationDTO>.from(state.items); | currentItems = List<NotificationDTO>.from(state.items); | ||||
| currentPage = state.page; | currentPage = state.page; | ||||
| currentHasReachedMax = state.hasReachedMax; | currentHasReachedMax = state.hasReachedMax; | ||||
| return Column( | return Column( | ||||
| children: <Widget>[ | children: <Widget>[ | ||||
| Container( | Container( | ||||
| color: Colors.white, | color: Colors.white, | ||||
| child: Row( | child: Row( | ||||
| children: [ | children: [ | ||||
| SizedBox( | |||||
| height: 8, | |||||
| ), | |||||
| Expanded( | Expanded( | ||||
| child: Text( | child: Text( | ||||
| 'Thông báo', | 'Thông báo', |
| } else if (noti.contents == "PIC_UPDATE") { | } else if (noti.contents == "PIC_UPDATE") { | ||||
| Get.to(PlotInformationScreen( | Get.to(PlotInformationScreen( | ||||
| cropId: noti.tbCropId, | cropId: noti.tbCropId, | ||||
| isShowAppbar: true, | |||||
| )); | )); | ||||
| } else { | } else { | ||||
| //Go home | //Go home | ||||
| @override | @override | ||||
| Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
| return Scaffold( | return Scaffold( | ||||
| backgroundColor: Colors.white, | |||||
| key: _scaffoldKey, | |||||
| appBar: AppBarWidget( | |||||
| isBack: false, | |||||
| ), | |||||
| body: InfinityView()); | |||||
| backgroundColor: Colors.white, key: _scaffoldKey, body: InfinityView()); | |||||
| } | } | ||||
| } | } | ||||
| return Column( | return Column( | ||||
| crossAxisAlignment: CrossAxisAlignment.start, | crossAxisAlignment: CrossAxisAlignment.start, | ||||
| children: <Widget>[ | children: <Widget>[ | ||||
| SizedBox( | |||||
| height: 8, | |||||
| ), | |||||
| Container( | Container( | ||||
| padding: EdgeInsets.all(8), | padding: EdgeInsets.all(8), | ||||
| color: Colors.white, | color: Colors.white, |
| Widget getSearchBarUI() { | Widget getSearchBarUI() { | ||||
| _searchController.text = ""; | _searchController.text = ""; | ||||
| return Padding( | return Padding( | ||||
| padding: const EdgeInsets.only(left: 8, right: 8, top: 4, bottom: 4), | |||||
| padding: const EdgeInsets.only(left: 8, right: 8, top: 0, bottom: 4), | |||||
| child: Row( | child: Row( | ||||
| children: <Widget>[ | children: <Widget>[ | ||||
| Expanded( | Expanded( | ||||
| child: Padding( | child: Padding( | ||||
| padding: const EdgeInsets.only(right: 8, top: 8, bottom: 0), | |||||
| padding: const EdgeInsets.only(right: 8, top: 0, bottom: 0), | |||||
| child: Container( | child: Container( | ||||
| child: Padding( | child: Padding( | ||||
| padding: const EdgeInsets.only( | padding: const EdgeInsets.only( |
| style: TextStyle( | style: TextStyle( | ||||
| color: selectedTab.index == 0 | color: selectedTab.index == 0 | ||||
| ? AppColors.DEFAULT | ? AppColors.DEFAULT | ||||
| : Colors.black), | |||||
| : Colors.black, | |||||
| fontSize: 12), | |||||
| ), | ), | ||||
| ), | ), | ||||
| Container( | Container( | ||||
| style: TextStyle( | style: TextStyle( | ||||
| color: selectedTab.index == 1 | color: selectedTab.index == 1 | ||||
| ? AppColors.DEFAULT | ? AppColors.DEFAULT | ||||
| : Colors.black)), | |||||
| : Colors.black, | |||||
| fontSize: 12)), | |||||
| ), | ), | ||||
| Container( | Container( | ||||
| padding: EdgeInsets.only(top: 8, bottom: 8), | padding: EdgeInsets.only(top: 8, bottom: 8), | ||||
| style: TextStyle( | style: TextStyle( | ||||
| color: selectedTab.index == 2 | color: selectedTab.index == 2 | ||||
| ? AppColors.DEFAULT | ? AppColors.DEFAULT | ||||
| : Colors.black)), | |||||
| : Colors.black, | |||||
| fontSize: 12)), | |||||
| ), | ), | ||||
| Container( | Container( | ||||
| padding: EdgeInsets.only(top: 8, bottom: 8), | padding: EdgeInsets.only(top: 8, bottom: 8), | ||||
| style: TextStyle( | style: TextStyle( | ||||
| color: selectedTab.index == 3 | color: selectedTab.index == 3 | ||||
| ? AppColors.DEFAULT | ? AppColors.DEFAULT | ||||
| : Colors.black)), | |||||
| : Colors.black, | |||||
| fontSize: 12)), | |||||
| ) | ) | ||||
| ], | ], | ||||
| ); | ); |
| itemsTabbar[index].index) | itemsTabbar[index].index) | ||||
| ? AppColors.DEFAULT | ? AppColors.DEFAULT | ||||
| : Colors.grey, | : Colors.grey, | ||||
| fontSize: 11), | |||||
| fontSize: 10), | |||||
| ), | ), | ||||
| ) | ) | ||||
| ], | ], |