mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-03-11 05:51:44 +00:00
Compare commits
5 Commits
SP-1523-FE
...
fix-flush-
| Author | SHA1 | Date | |
|---|---|---|---|
| 3589e349b3 | |||
| 86bd3fdd5b | |||
| 2e2db90c19 | |||
| 21cad0d9e8 | |||
| 9c6ab888a7 |
@ -22,7 +22,7 @@ class FlushSensorBloc extends Bloc<FlushSensorEvent, FlushSensorState> {
|
||||
on<FlushSensorChangeValueEvent>(_changeValue);
|
||||
on<FlushSensorUpdatedEvent>(_flushSensorUpdated);
|
||||
on<FlushSensorGetDeviceReportsEvent>(_getDeviceReports);
|
||||
on<FlushSensorInitialDeviseInfo>(fetchDeviceInfo);
|
||||
on<FlushSensorInitialDeviceInfo>(fetchDeviceInfo);
|
||||
}
|
||||
|
||||
void _fetchFlushSensorStatus(
|
||||
@ -163,7 +163,7 @@ class FlushSensorBloc extends Bloc<FlushSensorEvent, FlushSensorState> {
|
||||
);
|
||||
static String deviceName = '';
|
||||
|
||||
void fetchDeviceInfo(FlushSensorInitialDeviseInfo event,
|
||||
void fetchDeviceInfo(FlushSensorInitialDeviceInfo event,
|
||||
Emitter<FlushSensorState> emit) async {
|
||||
try {
|
||||
emit(FlushSensorLoadingInitialState());
|
||||
|
||||
@ -11,7 +11,7 @@ class FlushSensorLoadingEvent extends FlushSensorEvent {}
|
||||
|
||||
class FlushSensorInitialEvent extends FlushSensorEvent {}
|
||||
|
||||
class FlushSensorInitialDeviseInfo extends FlushSensorEvent {}
|
||||
class FlushSensorInitialDeviceInfo extends FlushSensorEvent {}
|
||||
|
||||
class FlushSensorUpdatedEvent extends FlushSensorEvent {}
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@ import 'package:syncrow_app/features/devices/bloc/flush_sensor_bloc/flush_sensor
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/flush_sensor_model.dart';
|
||||
import 'package:syncrow_app/features/devices/view/device_settings/settings_page.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/device_appbar.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/flush_sensor/flush_persence_records.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/flush_sensor/flush_sensor_option.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
@ -20,7 +19,6 @@ import 'package:syncrow_app/utils/context_extension.dart';
|
||||
import 'package:syncrow_app/utils/helpers/misc_string_helpers.dart';
|
||||
import 'package:syncrow_app/utils/helpers/snack_bar.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/font_manager.dart';
|
||||
part "presence_indicator.dart";
|
||||
part "flush_sensor_options_list.dart";
|
||||
@ -33,7 +31,8 @@ class FlushMountedInterface extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => FlushSensorBloc(deviceId: deviceModel.uuid ?? '')
|
||||
..add(FlushSensorInitialEvent()),
|
||||
..add(FlushSensorInitialEvent())
|
||||
..add(FlushSensorInitialDeviceInfo()),
|
||||
child: BlocBuilder<FlushSensorBloc, FlushSensorState>(
|
||||
builder: (context, state) {
|
||||
final bloc = BlocProvider.of<FlushSensorBloc>(context);
|
||||
@ -72,7 +71,7 @@ class FlushMountedInterface extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
if (val == null) {
|
||||
bloc.add(FlushSensorInitialDeviseInfo());
|
||||
bloc.add(FlushSensorInitialDeviceInfo());
|
||||
bloc.add(FlushSensorInitialEvent());
|
||||
}
|
||||
},
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart';
|
||||
import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart';
|
||||
import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/build_number_environment.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
@ -51,6 +52,7 @@ class MenuView extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
buildNumberAndEnvironmentLabel()
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
16
lib/features/shared_widgets/build_number_environment.dart
Normal file
16
lib/features/shared_widgets/build_number_environment.dart
Normal file
@ -0,0 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:syncrow_app/main.dart';
|
||||
|
||||
Widget buildNumberAndEnvironmentLabel() {
|
||||
String envNAME = dotenv.env['ENV_NAME'] ?? '';
|
||||
|
||||
return SizedBox(
|
||||
child: Center(
|
||||
child: Text(
|
||||
'\n$envNAME \nBuild Number $buildNumber',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -9,6 +9,9 @@ import 'package:syncrow_app/utils/bloc_observer.dart';
|
||||
import 'package:syncrow_app/utils/helpers/localization_helpers.dart';
|
||||
import 'my_app.dart';
|
||||
|
||||
|
||||
const String buildNumber = '1.0.30+17';
|
||||
|
||||
void main() {
|
||||
//to observe the state of the blocs in the output console
|
||||
Bloc.observer = MyBlocObserver();
|
||||
|
||||
@ -579,7 +579,7 @@ class DevicesAPI {
|
||||
.replaceAll('{code}', code),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
return DeviceReport.fromJson(json);
|
||||
return DeviceReport.fromJson(json['data'] as Map<String, dynamic>);
|
||||
},
|
||||
);
|
||||
return response;
|
||||
|
||||
Reference in New Issue
Block a user