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,11 +2,13 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:sfm_app/product/shared/shared_component_loading_animation.dart';
|
||||
import 'package:simple_ripple_animation/simple_ripple_animation.dart';
|
||||
|
||||
import '../../../product/constant/image/image_constants.dart';
|
||||
import '../../../product/shared/shared_line_chart.dart';
|
||||
import '../../../product/shared/shared_curve.dart';
|
||||
import '../../../product/shared/shared_loading_animation.dart';
|
||||
import '../../device_log/device_logs_model.dart';
|
||||
import '../device_model.dart';
|
||||
import '../../../product/base/bloc/base_bloc.dart';
|
||||
@@ -92,8 +94,11 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
||||
widget.thingID,
|
||||
controller,
|
||||
);
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: Center(
|
||||
child: Text(appLocalization(context).no_data_message),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return StreamBuilder<Map<String, dynamic>>(
|
||||
@@ -125,28 +130,6 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
// Center(
|
||||
// child: Container(
|
||||
// height: 50,
|
||||
// width: 400,
|
||||
// // color: Colors.blueAccent,
|
||||
// alignment: Alignment.centerRight,
|
||||
// margin: const EdgeInsets.fromLTRB(0, 0, 0, 50),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// const SizedBox(),
|
||||
// Text(
|
||||
// deviceSnapshot.data?.name ?? "",
|
||||
// style: const TextStyle(
|
||||
// fontSize: 25,
|
||||
// fontWeight: FontWeight.w600,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -541,12 +524,10 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
||||
builder: (context, sensorTempsSnapshot) {
|
||||
if (sensorTempsSnapshot.data == null) {
|
||||
detailDeviceBloc
|
||||
.getNearerSensorValue(widget.thingID);
|
||||
.getNearerSensorValue(context,widget.thingID);
|
||||
return const AspectRatio(
|
||||
aspectRatio: 3,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
child: SharedComponentLoadingAnimation(),
|
||||
);
|
||||
} else if (sensorTempsSnapshot.data!.isEmpty) {
|
||||
return Center(
|
||||
@@ -657,12 +638,7 @@ class _DetailDeviceScreenState extends State<DetailDeviceScreen> {
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
return const SharedLoadingAnimation();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user