update
feat(api_service): Update try-catch funtion and handle exception update(loading_animation): Update loading animation using Lottie
This commit is contained in:
@@ -4,6 +4,8 @@ import 'package:data_table_2/data_table_2.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import '../../product/shared/shared_component_loading_animation.dart';
|
||||
import '../../product/shared/shared_loading_animation.dart';
|
||||
import 'add_new_device_widget.dart';
|
||||
import 'delete_device_widget.dart';
|
||||
import 'device_model.dart';
|
||||
@@ -41,7 +43,7 @@ class _DevicesManagerScreenState extends State<DevicesManagerScreen> {
|
||||
const duration = Duration(seconds: 10);
|
||||
getAllDevicesTimer = Timer.periodic(
|
||||
duration,
|
||||
(Timer t) => devicesManagerBloc.getDeviceByState(tagIndex),
|
||||
(Timer t) => devicesManagerBloc.getDeviceByState(context,tagIndex),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -68,8 +70,8 @@ class _DevicesManagerScreenState extends State<DevicesManagerScreen> {
|
||||
builder: (context, allDeviceSnapshot) {
|
||||
if(allDeviceSnapshot.data == null){
|
||||
devicesManagerBloc
|
||||
.getDeviceByState(tagSnapshot.data?[0] ?? -2);
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
.getDeviceByState(context,tagSnapshot.data?[0] ?? -2);
|
||||
return const SharedLoadingAnimation();
|
||||
}
|
||||
if (allDeviceSnapshot.data!.isEmpty) {
|
||||
return Center(
|
||||
@@ -219,10 +221,9 @@ class _DevicesManagerScreenState extends State<DevicesManagerScreen> {
|
||||
stream: devicesManagerBloc.streamDeviceByState,
|
||||
builder: (context, devicesByStateSnapshot) {
|
||||
if (devicesByStateSnapshot.data == null) {
|
||||
devicesManagerBloc.getDeviceByState(
|
||||
devicesManagerBloc.getDeviceByState(context,
|
||||
tagSnapshot.data?[0] ?? -2);
|
||||
return const Center(
|
||||
child: CircularProgressIndicator());
|
||||
return const SharedComponentLoadingAnimation();
|
||||
} else {
|
||||
return SharedPieChart(
|
||||
deviceByState:
|
||||
@@ -392,7 +393,7 @@ class TagState extends StatelessWidget {
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
devicesManagerBloc.getDeviceByState(-2);
|
||||
devicesManagerBloc.getDeviceByState(context,-2);
|
||||
},
|
||||
child: const Icon(
|
||||
Icons.close,
|
||||
|
||||
Reference in New Issue
Block a user