mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 10:44:55 +00:00
4 scene & 6scene & sos
This commit is contained in:
@ -9,7 +9,7 @@ import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_report_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/group_devices_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_info_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/sex_scene_question_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/six_scene_question_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/six_scene_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/status_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/subspace_model.dart';
|
||||
@ -48,6 +48,8 @@ class SixSceneBloc extends Bloc<SixSceneEvent, SixSceneState> {
|
||||
on<SixSceneInitialQuestion>(_onSixSceneInitial);
|
||||
on<DeleteDeviceEvent>(deleteDevice);
|
||||
on<ToggleEnableAlarmEvent>(_toggleLowBattery);
|
||||
on<ToggleUpdateEvent>(_toggleUpdate);
|
||||
on<ToggleHelpfulEvent>(_toggleHelpful);
|
||||
}
|
||||
|
||||
final TextEditingController nameController =
|
||||
@ -506,4 +508,30 @@ class SixSceneBloc extends Bloc<SixSceneEvent, SixSceneState> {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
bool enableUpdate = false;
|
||||
|
||||
void _toggleUpdate(
|
||||
ToggleUpdateEvent event, Emitter<SixSceneState> emit) async {
|
||||
try {
|
||||
emit(SixSceneLoadingState());
|
||||
enableUpdate = event.isUpdateEnabled!;
|
||||
emit(SaveState());
|
||||
} catch (e) {
|
||||
emit(const SixSceneFailedState(errorMessage: 'Something went wrong'));
|
||||
}
|
||||
}
|
||||
|
||||
bool isHelpful = false;
|
||||
|
||||
void _toggleHelpful(
|
||||
ToggleHelpfulEvent event, Emitter<SixSceneState> emit) async {
|
||||
try {
|
||||
emit(SixSceneLoadingState());
|
||||
isHelpful = event.isHelpful!;
|
||||
emit(SaveState());
|
||||
} catch (e) {
|
||||
emit(const SixSceneFailedState(errorMessage: 'Something went wrong'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -222,3 +222,16 @@ class AssignRoomEvent extends SixSceneEvent {
|
||||
context,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
class ToggleUpdateEvent extends SixSceneEvent {
|
||||
final bool? isUpdateEnabled;
|
||||
const ToggleUpdateEvent({this.isUpdateEnabled});
|
||||
}
|
||||
|
||||
|
||||
class ToggleHelpfulEvent extends SixSceneEvent {
|
||||
final bool? isHelpful;
|
||||
const ToggleHelpfulEvent({this.isHelpful});
|
||||
}
|
||||
@ -2,7 +2,7 @@ import 'package:equatable/equatable.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/group_devices_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_info_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/sex_scene_question_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/six_scene_question_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/six_scene_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/subspace_model.dart';
|
||||
import 'package:syncrow_app/features/scene/model/scenes_model.dart';
|
||||
|
||||
@ -49,6 +49,8 @@ class FourSceneBloc extends Bloc<FourSceneEvent, FourSceneState> {
|
||||
on<SelectSceneEvent>(_selectScene);
|
||||
on<DeleteDeviceEvent>(deleteDevice);
|
||||
on<ToggleEnableAlarmEvent>(_toggleLowBattery);
|
||||
on<ToggleUpdateEvent>(_toggleUpdate);
|
||||
on<ToggleHelpfulEvent>(_toggleHelpful);
|
||||
}
|
||||
|
||||
final TextEditingController nameController =
|
||||
@ -261,8 +263,7 @@ class FourSceneBloc extends Bloc<FourSceneEvent, FourSceneState> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _toggleLowBattery(
|
||||
void _toggleLowBattery(
|
||||
ToggleEnableAlarmEvent event, Emitter<FourSceneState> emit) async {
|
||||
emit(LoadingNewSate(device: deviceStatus));
|
||||
try {
|
||||
@ -544,4 +545,30 @@ class FourSceneBloc extends Bloc<FourSceneEvent, FourSceneState> {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
bool enableUpdate = false;
|
||||
|
||||
void _toggleUpdate(
|
||||
ToggleUpdateEvent event, Emitter<FourSceneState> emit) async {
|
||||
try {
|
||||
emit(FourSceneLoadingState());
|
||||
enableUpdate = event.isUpdateEnabled!;
|
||||
emit(SaveState());
|
||||
} catch (e) {
|
||||
emit(const FourSceneFailedState(errorMessage: 'Something went wrong'));
|
||||
}
|
||||
}
|
||||
|
||||
bool isHelpful = false;
|
||||
|
||||
void _toggleHelpful(
|
||||
ToggleHelpfulEvent event, Emitter<FourSceneState> emit) async {
|
||||
try {
|
||||
emit(FourSceneLoadingState());
|
||||
isHelpful = event.isHelpful!;
|
||||
emit(SaveState());
|
||||
} catch (e) {
|
||||
emit(const FourSceneFailedState(errorMessage: 'Something went wrong'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -232,3 +232,13 @@ class GetSceneBySwitchName extends FourSceneEvent {
|
||||
|
||||
const GetSceneBySwitchName({this.switchName});
|
||||
}
|
||||
class ToggleUpdateEvent extends FourSceneEvent {
|
||||
final bool? isUpdateEnabled;
|
||||
const ToggleUpdateEvent({this.isUpdateEnabled});
|
||||
}
|
||||
|
||||
|
||||
class ToggleHelpfulEvent extends FourSceneEvent {
|
||||
final bool? isHelpful;
|
||||
const ToggleHelpfulEvent({this.isHelpful});
|
||||
}
|
||||
@ -39,7 +39,8 @@ class SosBloc extends Bloc<SosEvent, SosState> {
|
||||
on<AssignRoomEvent>(_assignDevice);
|
||||
on<SosInitialDeviseInfo>(fetchDeviceInfo);
|
||||
on<SaveNameEvent>(saveName);
|
||||
// on<UnassignRoomEvent>(_unassignDevice);
|
||||
on<ToggleUpdateEvent>(_toggleUpdate);
|
||||
on<ToggleHelpfulEvent>(_toggleHelpful);
|
||||
// on<ToggleWaterLeakAlarmEvent>(_toggleWaterLeakAlarm);
|
||||
}
|
||||
|
||||
@ -440,4 +441,28 @@ class SosBloc extends Bloc<SosEvent, SosState> {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
bool enableUpdate = false;
|
||||
|
||||
void _toggleUpdate(ToggleUpdateEvent event, Emitter<SosState> emit) async {
|
||||
try {
|
||||
emit(SosLoadingState());
|
||||
enableUpdate = event.isUpdateEnabled!;
|
||||
emit(SaveState());
|
||||
} catch (e) {
|
||||
emit(SosFailedState(errorMessage: e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
bool isHelpful = false;
|
||||
|
||||
void _toggleHelpful(ToggleHelpfulEvent event, Emitter<SosState> emit) async {
|
||||
try {
|
||||
emit(SosLoadingState());
|
||||
isHelpful = event.isHelpful!;
|
||||
emit(SaveState());
|
||||
} catch (e) {
|
||||
emit(SosFailedState(errorMessage: e.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,3 +194,13 @@ class LoadingDeviceInfo extends SosEvent {
|
||||
@override
|
||||
List<Object> get props => [deviceInfo];
|
||||
}
|
||||
|
||||
class ToggleUpdateEvent extends SosEvent {
|
||||
final bool? isUpdateEnabled;
|
||||
const ToggleUpdateEvent({this.isUpdateEnabled});
|
||||
}
|
||||
|
||||
class ToggleHelpfulEvent extends SosEvent {
|
||||
final bool? isHelpful;
|
||||
const ToggleHelpfulEvent({this.isHelpful});
|
||||
}
|
||||
@ -15,6 +15,9 @@ class SosState extends Equatable {
|
||||
class SosInitialState extends SosState {}
|
||||
|
||||
class SosLoadingState extends SosState {}
|
||||
|
||||
|
||||
|
||||
class SaveState extends SosState {}
|
||||
|
||||
class LoadingSosDeviceInfo extends SosState {
|
||||
|
||||
@ -5,7 +5,7 @@ import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_bl
|
||||
import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_event.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_state.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/sex_scene_question_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/six_scene_question_model.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/6_scene_switch/6_scene_setting/question_page.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
@ -89,6 +89,9 @@ class FaqSixScenePage extends StatelessWidget {
|
||||
fontSize: 12,
|
||||
fontColor: ColorsManager.grayColor,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
displayedQuestions.isEmpty
|
||||
? const SizedBox()
|
||||
: DefaultContainer(
|
||||
@ -132,9 +135,12 @@ class FaqSixScenePage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
if (index !=
|
||||
displayedQuestions.length -
|
||||
1) // Exclude divider for the last item
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -4,7 +4,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_event.dart';
|
||||
import 'package:syncrow_app/features/devices/bloc/6_scene_switch_bloc/6_scene_state.dart';
|
||||
import 'package:syncrow_app/features/devices/model/sex_scene_question_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/six_scene_question_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/six_scene_model.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_button.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
@ -86,9 +86,14 @@ class QuestionPage extends StatelessWidget {
|
||||
child: SizedBox(
|
||||
width: 180,
|
||||
child: DefaultButton(
|
||||
backgroundColor: ColorsManager.grayButtonColors,
|
||||
backgroundColor: sensor.isHelpful == true
|
||||
? ColorsManager.grayColor
|
||||
: ColorsManager.grayButtonColors,
|
||||
borderRadius: 50,
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
sensor
|
||||
.add(ToggleHelpfulEvent(isHelpful: true));
|
||||
},
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -97,10 +102,10 @@ class QuestionPage extends StatelessWidget {
|
||||
Assets.thumbUp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
BodyMedium(
|
||||
const BodyMedium(
|
||||
text: 'Helpful',
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
@ -110,16 +115,21 @@ class QuestionPage extends StatelessWidget {
|
||||
)),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Center(
|
||||
child: SizedBox(
|
||||
width: 180,
|
||||
child: DefaultButton(
|
||||
backgroundColor: ColorsManager.grayButtonColors,
|
||||
backgroundColor: sensor.isHelpful == false
|
||||
? ColorsManager.grayColor
|
||||
: ColorsManager.grayButtonColors,
|
||||
borderRadius: 50,
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
sensor.add(
|
||||
ToggleHelpfulEvent(isHelpful: false));
|
||||
},
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -128,10 +138,10 @@ class QuestionPage extends StatelessWidget {
|
||||
Assets.thumbDown,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
BodyMedium(
|
||||
const BodyMedium(
|
||||
text: 'Not Helpful',
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
|
||||
@ -26,6 +26,8 @@ class SixSceneUpdatePage extends StatelessWidget {
|
||||
SixSceneBloc(sixSceneId: '')..add(const SixSceneInitial()),
|
||||
child: BlocBuilder<SixSceneBloc, SixSceneState>(
|
||||
builder: (context, state) {
|
||||
final _bloc = BlocProvider.of<SixSceneBloc>(context);
|
||||
|
||||
return state is SixSceneLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
@ -87,15 +89,20 @@ class SixSceneUpdatePage extends StatelessWidget {
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
const BodyMedium(
|
||||
text: 'Off',
|
||||
BodyMedium(
|
||||
text: _bloc.enableUpdate
|
||||
? 'true'
|
||||
: 'Off',
|
||||
fontColor: ColorsManager.textGray,
|
||||
),
|
||||
Transform.scale(
|
||||
scale: .8,
|
||||
child: CupertinoSwitch(
|
||||
value: true,
|
||||
onChanged: (value) {},
|
||||
value: _bloc.enableUpdate,
|
||||
onChanged: (value) {
|
||||
_bloc.add(ToggleUpdateEvent(
|
||||
isUpdateEnabled: value));
|
||||
},
|
||||
applyTheme: true,
|
||||
),
|
||||
),
|
||||
|
||||
@ -89,6 +89,9 @@ class FaqFourScenePage extends StatelessWidget {
|
||||
fontSize: 12,
|
||||
fontColor: ColorsManager.grayColor,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
displayedQuestions.isEmpty
|
||||
? const SizedBox()
|
||||
: DefaultContainer(
|
||||
@ -133,9 +136,12 @@ class FaqFourScenePage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
if (index !=
|
||||
displayedQuestions.length -
|
||||
1) // Exclude divider for the last item
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -26,6 +26,8 @@ class FourSceneUpdatePage extends StatelessWidget {
|
||||
FourSceneBloc(fourSceneId: '')..add(const FourSceneInitial()),
|
||||
child: BlocBuilder<FourSceneBloc, FourSceneState>(
|
||||
builder: (context, state) {
|
||||
final _bloc = BlocProvider.of<FourSceneBloc>(context);
|
||||
|
||||
return state is FourSceneLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
@ -87,15 +89,20 @@ class FourSceneUpdatePage extends StatelessWidget {
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
const BodyMedium(
|
||||
text: 'Off',
|
||||
BodyMedium(
|
||||
text: _bloc.enableUpdate
|
||||
? 'true'
|
||||
: 'Off',
|
||||
fontColor: ColorsManager.textGray,
|
||||
),
|
||||
Transform.scale(
|
||||
scale: .8,
|
||||
child: CupertinoSwitch(
|
||||
value: true,
|
||||
onChanged: (value) {},
|
||||
value: _bloc.enableUpdate,
|
||||
onChanged: (value) {
|
||||
_bloc.add(ToggleUpdateEvent(
|
||||
isUpdateEnabled: value));
|
||||
},
|
||||
applyTheme: true,
|
||||
),
|
||||
),
|
||||
|
||||
@ -84,9 +84,14 @@ class QuestionPageFourScene extends StatelessWidget {
|
||||
child: SizedBox(
|
||||
width: 180,
|
||||
child: DefaultButton(
|
||||
backgroundColor: ColorsManager.grayButtonColors,
|
||||
backgroundColor: sensor.isHelpful == true
|
||||
? ColorsManager.grayColor
|
||||
: ColorsManager.grayButtonColors,
|
||||
borderRadius: 50,
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
sensor
|
||||
.add(ToggleHelpfulEvent(isHelpful: true));
|
||||
},
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -95,10 +100,10 @@ class QuestionPageFourScene extends StatelessWidget {
|
||||
Assets.thumbUp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
BodyMedium(
|
||||
const BodyMedium(
|
||||
text: 'Helpful',
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
@ -108,16 +113,21 @@ class QuestionPageFourScene extends StatelessWidget {
|
||||
)),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Center(
|
||||
child: SizedBox(
|
||||
width: 180,
|
||||
child: DefaultButton(
|
||||
backgroundColor: ColorsManager.grayButtonColors,
|
||||
backgroundColor: sensor.isHelpful == false
|
||||
? ColorsManager.grayColor
|
||||
: ColorsManager.grayButtonColors,
|
||||
borderRadius: 50,
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
sensor.add(
|
||||
ToggleHelpfulEvent(isHelpful: false));
|
||||
},
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -126,10 +136,10 @@ class QuestionPageFourScene extends StatelessWidget {
|
||||
Assets.thumbDown,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
BodyMedium(
|
||||
const BodyMedium(
|
||||
text: 'Not Helpful',
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
|
||||
@ -89,57 +89,70 @@ class FaqSosPage extends StatelessWidget {
|
||||
fontSize: 12,
|
||||
fontColor: ColorsManager.grayColor,
|
||||
),
|
||||
Expanded(
|
||||
child: DefaultContainer(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: displayedQuestions.length,
|
||||
itemBuilder: (context, index) {
|
||||
final faq = displayedQuestions[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => QuestionPage(
|
||||
questionModel: faq,
|
||||
)),
|
||||
);
|
||||
},
|
||||
child: SizedBox(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
displayedQuestions.isEmpty
|
||||
? const SizedBox()
|
||||
: DefaultContainer(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: displayedQuestions.length,
|
||||
itemBuilder: (context, index) {
|
||||
final faq = displayedQuestions[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
QuestionPage(
|
||||
questionModel: faq,
|
||||
)),
|
||||
);
|
||||
},
|
||||
child: SizedBox(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: BodyMedium(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
text: faq.question,
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: BodyMedium(
|
||||
fontSize: 14,
|
||||
fontWeight:
|
||||
FontWeight.w400,
|
||||
text: faq.question,
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icons.keyboard_arrow_right,
|
||||
color:
|
||||
ColorsManager.textGray,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
Icons.keyboard_arrow_right,
|
||||
color: ColorsManager.textGray,
|
||||
),
|
||||
if (index !=
|
||||
displayedQuestions.length -
|
||||
1) // Exclude divider for the last item
|
||||
const Divider(
|
||||
color:
|
||||
ColorsManager.dividerColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
)),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@ -78,9 +78,14 @@ class QuestionPage extends StatelessWidget {
|
||||
child: SizedBox(
|
||||
width: 180,
|
||||
child: DefaultButton(
|
||||
backgroundColor: ColorsManager.grayButtonColors,
|
||||
backgroundColor: sensor.isHelpful == true
|
||||
? ColorsManager.grayColor
|
||||
: ColorsManager.grayButtonColors,
|
||||
borderRadius: 50,
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
sensor
|
||||
.add(ToggleHelpfulEvent(isHelpful: true));
|
||||
},
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -89,10 +94,10 @@ class QuestionPage extends StatelessWidget {
|
||||
Assets.thumbUp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
BodyMedium(
|
||||
const BodyMedium(
|
||||
text: 'Helpful',
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
@ -102,16 +107,21 @@ class QuestionPage extends StatelessWidget {
|
||||
)),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Center(
|
||||
child: SizedBox(
|
||||
width: 180,
|
||||
child: DefaultButton(
|
||||
backgroundColor: ColorsManager.grayButtonColors,
|
||||
backgroundColor: sensor.isHelpful == false
|
||||
? ColorsManager.grayColor
|
||||
: ColorsManager.grayButtonColors,
|
||||
borderRadius: 50,
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
sensor.add(
|
||||
ToggleHelpfulEvent(isHelpful: false));
|
||||
},
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -120,10 +130,10 @@ class QuestionPage extends StatelessWidget {
|
||||
Assets.thumbDown,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
BodyMedium(
|
||||
const BodyMedium(
|
||||
text: 'Not Helpful',
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
|
||||
@ -25,6 +25,8 @@ class SosUpdatePage extends StatelessWidget {
|
||||
create: (context) => SosBloc(sosId: '')..add(const SosInitial()),
|
||||
child: BlocBuilder<SosBloc, SosState>(
|
||||
builder: (context, state) {
|
||||
final _bloc = BlocProvider.of<SosBloc>(context);
|
||||
|
||||
return state is SosLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
@ -72,6 +74,7 @@ class SosUpdatePage extends StatelessWidget {
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: const BodyMedium(
|
||||
|
||||
text: 'Automatic Update',
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
@ -85,21 +88,27 @@ class SosUpdatePage extends StatelessWidget {
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
const BodyMedium(
|
||||
text: 'Off',
|
||||
BodyMedium(
|
||||
text: _bloc.enableUpdate
|
||||
? 'true'
|
||||
: 'Off',
|
||||
fontColor: ColorsManager.textGray,
|
||||
),
|
||||
Transform.scale(
|
||||
scale: .8,
|
||||
child: CupertinoSwitch(
|
||||
value: true,
|
||||
onChanged: (value) {},
|
||||
value: _bloc.enableUpdate,
|
||||
onChanged: (value) {
|
||||
_bloc.add(ToggleUpdateEvent(
|
||||
isUpdateEnabled: value));
|
||||
},
|
||||
applyTheme: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
)
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -107,7 +116,7 @@ class SosUpdatePage extends StatelessWidget {
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
UpdateSosContainerWithProgressBar(
|
||||
const UpdateSosContainerWithProgressBar(
|
||||
sosDescription:
|
||||
'Connectivity Issue Resolved Fixed a bug that caused the SOS button to disconnect from the app intermittently.',
|
||||
sosVersion: 'SOS v2.0.5',
|
||||
|
||||
@ -39,7 +39,6 @@ class SosSettings extends StatelessWidget {
|
||||
child: BlocBuilder<SosBloc, SosState>(
|
||||
builder: (context, state) {
|
||||
final _bloc = BlocProvider.of<SosBloc>(context);
|
||||
|
||||
SosModel model =
|
||||
SosModel(batteryPercentage: 0, sosContactState: 'normal');
|
||||
if (state is LoadingNewSate) {
|
||||
@ -177,15 +176,7 @@ class SosSettings extends StatelessWidget {
|
||||
context
|
||||
.read<SosBloc>()
|
||||
.add(ToggleEnableAlarmEvent(p0));
|
||||
// Transform.scale(
|
||||
// scale: .8,
|
||||
// child: CupertinoSwitch(
|
||||
// value: _bloc.enableAlarm,
|
||||
// onChanged: (value) {
|
||||
|
||||
// },
|
||||
// applyTheme: true,
|
||||
// )),
|
||||
},
|
||||
isNotification: true,
|
||||
onTap: () {},
|
||||
|
||||
Reference in New Issue
Block a user