update
feat(api_service): Update try-catch funtion and handle exception update(loading_animation): Update loading animation using Lottie
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../../product/shared/shared_component_loading_animation.dart';
|
||||
import '../../product/shared/shared_loading_animation.dart';
|
||||
import 'widgets/tag_widget.dart';
|
||||
import '../devices/device_model.dart';
|
||||
import '../../bloc/device_logs_bloc.dart';
|
||||
@@ -42,7 +44,7 @@ class _DeviceLogsScreenState extends State<DeviceLogsScreen> {
|
||||
() {
|
||||
if (controller.position.maxScrollExtent == controller.offset) {
|
||||
offset += 30;
|
||||
deviceLogsBloc.getDeviceLogByThingID(
|
||||
deviceLogsBloc.getDeviceLogByThingID(context,
|
||||
offset, thingID, dateTime!, sensors);
|
||||
}
|
||||
},
|
||||
@@ -64,10 +66,8 @@ class _DeviceLogsScreenState extends State<DeviceLogsScreen> {
|
||||
stream: deviceLogsBloc.streamAllDevices,
|
||||
builder: (context, allDevicesSnapshot) {
|
||||
if (allDevicesSnapshot.data == null) {
|
||||
deviceLogsBloc.getAllDevices();
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
deviceLogsBloc.getAllDevices(context);
|
||||
return const SharedLoadingAnimation();
|
||||
} else {
|
||||
return StreamBuilder<List<SensorLogs>>(
|
||||
stream: deviceLogsBloc.streamSensors,
|
||||
@@ -188,6 +188,7 @@ class _DeviceLogsScreenState extends State<DeviceLogsScreen> {
|
||||
);
|
||||
} else {
|
||||
deviceLogsBloc.getDeviceLogByThingID(
|
||||
context,
|
||||
offset,
|
||||
thingID,
|
||||
dateTime!,
|
||||
@@ -246,7 +247,7 @@ class _DeviceLogsScreenState extends State<DeviceLogsScreen> {
|
||||
return Center(
|
||||
child: hasMoreSnapshot.data ??
|
||||
hasMore
|
||||
? const CircularProgressIndicator()
|
||||
? const SharedComponentLoadingAnimation()
|
||||
: Text(
|
||||
appLocalization(context)
|
||||
.main_no_data),
|
||||
@@ -310,7 +311,7 @@ class _DeviceLogsScreenState extends State<DeviceLogsScreen> {
|
||||
deviceLogsBloc.sensors.add(sensors);
|
||||
hasMore = true;
|
||||
deviceLogsBloc.sinkHasMore.add(hasMore);
|
||||
deviceLogsBloc.getDeviceLogByThingID(offset, thingID, dateTime!, sensors);
|
||||
deviceLogsBloc.getDeviceLogByThingID(context,offset, thingID, dateTime!, sensors);
|
||||
}
|
||||
|
||||
Widget leadingList(SensorLogs sensor) {
|
||||
|
||||
Reference in New Issue
Block a user