mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-26 04:29:40 +00:00
user_agreement and privacy_policy sign up and menu
This commit is contained in:
@ -3,6 +3,8 @@ import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/privacy_policy.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/user_agreement.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_button.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart';
|
||||
@ -202,6 +204,82 @@ class SignUpView extends StatelessWidget {
|
||||
hint: "At least 8 characters"),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16.0),
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
text:
|
||||
'By signing up you agree to our ',
|
||||
style: const TextStyle(
|
||||
color: Colors
|
||||
.white, // White text color
|
||||
fontSize:
|
||||
14, // Adjust font size to match the design
|
||||
),
|
||||
children: [
|
||||
WidgetSpan(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
.push(MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const UserAgreement(),
|
||||
));
|
||||
},
|
||||
child: const Text(
|
||||
'Terms & Conditions',
|
||||
style: TextStyle(
|
||||
color: Colors
|
||||
.white, // Text color
|
||||
fontWeight: FontWeight
|
||||
.bold, // Bold text
|
||||
decoration: TextDecoration
|
||||
.underline, // Underline the text
|
||||
decorationColor: Colors
|
||||
.white, // Set the underline color to white
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const TextSpan(
|
||||
text: ' and ',
|
||||
style: TextStyle(
|
||||
color: Colors.white),
|
||||
),
|
||||
WidgetSpan(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context)
|
||||
.push(MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const PrivacyPolicy(),
|
||||
));
|
||||
},
|
||||
child: const Text(
|
||||
'Privacy Policy',
|
||||
style: TextStyle(
|
||||
color: Colors
|
||||
.white, // Text color
|
||||
fontWeight: FontWeight
|
||||
.bold, // Bold text
|
||||
decoration: TextDecoration
|
||||
.underline, // Underline the text
|
||||
decorationColor: Colors
|
||||
.white, // Set the underline color to white
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
textAlign: TextAlign
|
||||
.center, // Center align the text
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
@ -1,12 +1,35 @@
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/services/api/profile_api.dart';
|
||||
|
||||
part 'menu_state.dart';
|
||||
|
||||
class MenuCubit extends Cubit<MenuState> {
|
||||
MenuCubit() : super(MenuInitial());
|
||||
|
||||
static MenuCubit of(context) => BlocProvider.of<MenuCubit>(context);
|
||||
|
||||
String name = '';
|
||||
String userAgreementHtml = "";
|
||||
String privacyPolicyHtml = "";
|
||||
|
||||
Future<void> fetchAgreement() async {
|
||||
try {
|
||||
emit(MenuLoading());
|
||||
final response = await ProfileApi().fetchUserAgreement();
|
||||
userAgreementHtml = response;
|
||||
emit(MenuLoaded(userAgreementHtml));
|
||||
} catch (error) {
|
||||
emit(MenuError(error.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> fetchPrivacyPolicy() async {
|
||||
try {
|
||||
emit(MenuLoading());
|
||||
final response = await ProfileApi().fetchPrivacyPolicy();
|
||||
privacyPolicyHtml = response;
|
||||
emit(MenuLoaded(privacyPolicyHtml));
|
||||
} catch (error) {
|
||||
emit(MenuError(error.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,3 +3,22 @@ part of 'menu_cubit.dart';
|
||||
abstract class MenuState {}
|
||||
|
||||
class MenuInitial extends MenuState {}
|
||||
|
||||
class MenuLoading extends MenuState {}
|
||||
|
||||
class MenuLoaded extends MenuState {
|
||||
final String userAgreementHtml;
|
||||
MenuLoaded(this.userAgreementHtml);
|
||||
}
|
||||
|
||||
class MenuError extends MenuState {
|
||||
final String message;
|
||||
|
||||
MenuError(this.message);
|
||||
}
|
||||
|
||||
class MenuNameUpdated extends MenuState {
|
||||
final String name;
|
||||
|
||||
MenuNameUpdated(this.name);
|
||||
}
|
||||
|
47
lib/features/menu/bloc/privacy_policy.dart
Normal file
47
lib/features/menu/bloc/privacy_policy.dart
Normal file
@ -0,0 +1,47 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class PrivacyPolicy extends StatelessWidget {
|
||||
const PrivacyPolicy({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final menuCubit = MenuCubit.of(context);
|
||||
menuCubit.fetchPrivacyPolicy();
|
||||
return DefaultScaffold(
|
||||
title: 'Privacy Policy',
|
||||
child: BlocBuilder<MenuCubit, MenuState>(
|
||||
builder: (context, state) {
|
||||
if (state is MenuLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is MenuLoaded) {
|
||||
return ListView(
|
||||
children: [
|
||||
HtmlWidget(
|
||||
state.userAgreementHtml,
|
||||
onTapUrl: (url) async {
|
||||
final uri = Uri.parse(url);
|
||||
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||
return true;
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
} else if (state is MenuError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'Error: ${state.message}',
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
);
|
||||
}
|
||||
return const Center(child: Text('Loading User Agreement...'));
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
48
lib/features/menu/bloc/user_agreement.dart
Normal file
48
lib/features/menu/bloc/user_agreement.dart
Normal file
@ -0,0 +1,48 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class UserAgreement extends StatelessWidget {
|
||||
const UserAgreement({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final menuCubit = MenuCubit.of(context);
|
||||
menuCubit.fetchAgreement();
|
||||
return DefaultScaffold(
|
||||
title: 'User Agreement',
|
||||
child: BlocBuilder<MenuCubit, MenuState>(
|
||||
builder: (context, state) {
|
||||
if (state is MenuLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is MenuLoaded) {
|
||||
return ListView(
|
||||
children: [
|
||||
HtmlWidget(
|
||||
state
|
||||
.userAgreementHtml,
|
||||
onTapUrl: (url) async {
|
||||
final uri = Uri.parse(url);
|
||||
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||
return true;
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
} else if (state is MenuError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'Error: ${state.message}',
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
);
|
||||
}
|
||||
return const Center(child: Text('Loading User Agreement...'));
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
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/bloc/profile_bloc/profile_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/effective_period/effect_period_bloc.dart';
|
||||
@ -34,6 +35,7 @@ class MyApp extends StatelessWidget {
|
||||
BlocProvider(create: (context) => CreateSceneBloc()),
|
||||
BlocProvider(create: (context) => SceneBloc()),
|
||||
BlocProvider(create: (context) => ProfileBloc()),
|
||||
BlocProvider(create: (context) => MenuCubit()),
|
||||
],
|
||||
child: MaterialApp(
|
||||
navigatorKey: NavigationService.navigatorKey,
|
||||
|
@ -53,7 +53,8 @@ abstract class ApiEndpoints {
|
||||
//POST
|
||||
static const String addUnit = '/unit';
|
||||
static const String addUnitToUser = '/unit/user';
|
||||
static const String verifyInvitationCode = '/user/{userUuid}/spaces/verify-code';
|
||||
static const String verifyInvitationCode =
|
||||
'/user/{userUuid}/spaces/verify-code';
|
||||
|
||||
//GET
|
||||
static const String unitByUuid = '/unit/';
|
||||
@ -63,8 +64,7 @@ abstract class ApiEndpoints {
|
||||
static const String unitUser = '/unit/user/';
|
||||
static const String invitationCode =
|
||||
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{unitUuid}/invitation-code';
|
||||
static const String activationCode =
|
||||
'/invite-user/activation';
|
||||
static const String activationCode = '/invite-user/activation';
|
||||
|
||||
//PUT
|
||||
static const String renameUnit = '/unit/{unitUuid}';
|
||||
@ -97,7 +97,8 @@ abstract class ApiEndpoints {
|
||||
static const String controlGroup = '/group/control';
|
||||
//GET
|
||||
static const String groupBySpace = '/group/{unitUuid}';
|
||||
static const String devicesByGroupName = '/group/{unitUuid}/devices/{groupName}';
|
||||
static const String devicesByGroupName =
|
||||
'/group/{unitUuid}/devices/{groupName}';
|
||||
|
||||
static const String groupByUuid = '/group/{groupUuid}';
|
||||
//DELETE
|
||||
@ -109,7 +110,8 @@ abstract class ApiEndpoints {
|
||||
static const String addDeviceToRoom = '/device/room';
|
||||
static const String addDeviceToGroup = '/device/group';
|
||||
static const String controlDevice = '/device/{deviceUuid}/control';
|
||||
static const String firmwareDevice = '/device/{deviceUuid}/firmware/{firmwareVersion}';
|
||||
static const String firmwareDevice =
|
||||
'/device/{deviceUuid}/firmware/{firmwareVersion}';
|
||||
static const String getDevicesByUserId = '/device/user/{userId}';
|
||||
static const String getDevicesByUnitId = '/device/unit/{unitUuid}';
|
||||
static const String openDoorLock = '/door-lock/open/{doorLockUuid}';
|
||||
@ -120,8 +122,10 @@ abstract class ApiEndpoints {
|
||||
static const String deviceByUuid = '/device/{deviceUuid}';
|
||||
static const String deviceFunctions = '/device/{deviceUuid}/functions';
|
||||
static const String gatewayApi = '/device/gateway/{gatewayUuid}/devices';
|
||||
static const String deviceFunctionsStatus = '/device/{deviceUuid}/functions/status';
|
||||
static const String powerClamp = '/device/{powerClampUuid}/power-clamp/status';
|
||||
static const String deviceFunctionsStatus =
|
||||
'/device/{deviceUuid}/functions/status';
|
||||
static const String powerClamp =
|
||||
'/device/{powerClampUuid}/power-clamp/status';
|
||||
|
||||
///Device Permission Module
|
||||
//POST
|
||||
@ -149,14 +153,16 @@ abstract class ApiEndpoints {
|
||||
|
||||
static const String getUnitAutomation = '/automation/{unitUuid}';
|
||||
|
||||
static const String getAutomationDetails = '/automation/details/{automationId}';
|
||||
static const String getAutomationDetails =
|
||||
'/automation/details/{automationId}';
|
||||
|
||||
/// PUT
|
||||
static const String updateScene = '/scene/tap-to-run/{sceneId}';
|
||||
|
||||
static const String updateAutomation = '/automation/{automationId}';
|
||||
|
||||
static const String updateAutomationStatus = '/automation/status/{automationId}';
|
||||
static const String updateAutomationStatus =
|
||||
'/automation/status/{automationId}';
|
||||
|
||||
/// DELETE
|
||||
static const String deleteScene = '/scene/tap-to-run/{sceneId}';
|
||||
@ -165,8 +171,10 @@ abstract class ApiEndpoints {
|
||||
|
||||
//////////////////////Door Lock //////////////////////
|
||||
//online
|
||||
static const String addTemporaryPassword = '/door-lock/temporary-password/online/{doorLockUuid}';
|
||||
static const String getTemporaryPassword = '/door-lock/temporary-password/online/{doorLockUuid}';
|
||||
static const String addTemporaryPassword =
|
||||
'/door-lock/temporary-password/online/{doorLockUuid}';
|
||||
static const String getTemporaryPassword =
|
||||
'/door-lock/temporary-password/online/{doorLockUuid}';
|
||||
|
||||
//one-time offline
|
||||
static const String addOneTimeTemporaryPassword =
|
||||
@ -198,7 +206,8 @@ abstract class ApiEndpoints {
|
||||
'/door-lock/temporary-password/online/{doorLockUuid}/{passwordId}';
|
||||
|
||||
static const String saveSchedule = '/schedule/{deviceUuid}';
|
||||
static const String getSchedule = '/schedule/{deviceUuid}?category={category}';
|
||||
static const String getSchedule =
|
||||
'/schedule/{deviceUuid}?category={category}';
|
||||
static const String changeSchedule = '/schedule/enable/{deviceUuid}';
|
||||
static const String deleteSchedule = '/schedule/{deviceUuid}/{scheduleId}';
|
||||
static const String reportLogs =
|
||||
@ -207,9 +216,13 @@ abstract class ApiEndpoints {
|
||||
static const String statusBatch = '/device/status/batch';
|
||||
static const String deviceScene = '/device/{deviceUuid}/scenes';
|
||||
|
||||
static const String fourSceneByName = '/device/{deviceUuid}/scenes?switchName={switchName}';
|
||||
static const String fourSceneByName =
|
||||
'/device/{deviceUuid}/scenes?switchName={switchName}';
|
||||
|
||||
static const String resetDevice = '/factory/reset/{deviceUuid}';
|
||||
static const String unAssignScenesDevice = '/device/{deviceUuid}/scenes?switchName={switchName}';
|
||||
static const String unAssignScenesDevice =
|
||||
'/device/{deviceUuid}/scenes?switchName={switchName}';
|
||||
static const String getDeviceLogs = '/device/report-logs/{uuid}?code={code}';
|
||||
static const String terms = '/terms';
|
||||
static const String policy = '/policy';
|
||||
}
|
||||
|
@ -116,4 +116,24 @@ class ProfileApi {
|
||||
});
|
||||
return response as List<TimeZone>;
|
||||
}
|
||||
|
||||
Future fetchUserAgreement() async {
|
||||
final response = await _httpService.get(
|
||||
path: ApiEndpoints.terms,
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
return json['data'];
|
||||
});
|
||||
return response;
|
||||
}
|
||||
|
||||
Future fetchPrivacyPolicy() async {
|
||||
final response = await _httpService.get(
|
||||
path: ApiEndpoints.policy,
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
return json['data'];
|
||||
});
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
//ignore_for_file: constant_identifier_names
|
||||
import 'dart:ui';
|
||||
import 'package:syncrow_app/features/devices/model/function_model.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/privacy_policy.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/user_agreement.dart';
|
||||
// import 'package:syncrow_app/features/menu/view/widgets/create_home/create_home_view.dart';
|
||||
import 'package:syncrow_app/features/menu/view/widgets/join_home/join_home_view.dart';
|
||||
import 'package:syncrow_app/features/menu/view/widgets/manage_home/manage_home_view.dart';
|
||||
import 'package:syncrow_app/features/menu/view/widgets/privacy/privacy_view.dart';
|
||||
import 'package:syncrow_app/features/menu/view/widgets/securty/view/securty_view.dart';
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
@ -99,7 +100,9 @@ Map<String, DeviceType> devicesTypesMap = {
|
||||
Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
DeviceType.AC: [
|
||||
FunctionModel(
|
||||
code: 'switch', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'mode',
|
||||
type: functionTypesMap['Enum'],
|
||||
@ -122,7 +125,9 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
// "range": ["low", "middle", "high", "auto"]
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'child_lock', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'child_lock',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
],
|
||||
DeviceType.Gateway: [
|
||||
FunctionModel(
|
||||
@ -136,7 +141,9 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
"range": ["normal", "alarm"]
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'factory_reset', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'factory_reset',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'alarm_active',
|
||||
type: functionTypesMap['String'],
|
||||
@ -146,7 +153,8 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
FunctionModel(
|
||||
code: 'sensitivity',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "", "min": 1, "max": 10, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "", "min": 1, "max": 10, "scale": 0, "step": 1})),
|
||||
],
|
||||
DeviceType.DoorLock: [
|
||||
FunctionModel(
|
||||
@ -154,7 +162,9 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
type: functionTypesMap['Raw'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'remote_no_dp_key', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
|
||||
code: 'remote_no_dp_key',
|
||||
type: functionTypesMap['Raw'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'normal_open_switch',
|
||||
type: functionTypesMap['Boolean'],
|
||||
@ -164,64 +174,87 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
FunctionModel(
|
||||
code: 'far_detection',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "cm", "min": 75, "max": 600, "scale": 0, "step": 75})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "cm", "min": 75, "max": 600, "scale": 0, "step": 75})),
|
||||
FunctionModel(
|
||||
code: 'presence_time',
|
||||
type: functionTypesMap['Integer'],
|
||||
values:
|
||||
ValueModel.fromJson({"unit": "Min", "min": 0, "max": 65535, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "Min", "min": 0, "max": 65535, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'motion_sensitivity_value',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'motionless_sensitivity',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'indicator', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'indicator',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
],
|
||||
DeviceType.OneGang: [
|
||||
FunctionModel(
|
||||
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
],
|
||||
DeviceType.TwoGang: [
|
||||
FunctionModel(
|
||||
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_2', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_2',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_2',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
],
|
||||
DeviceType.ThreeGang: [
|
||||
FunctionModel(
|
||||
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_2', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_2',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_3', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_3',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_2',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_3',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
],
|
||||
DeviceType.Curtain: [
|
||||
FunctionModel(
|
||||
@ -233,15 +266,19 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
FunctionModel(
|
||||
code: 'percent_control',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1})),
|
||||
],
|
||||
DeviceType.WH: [
|
||||
FunctionModel(
|
||||
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'relay_status',
|
||||
type: functionTypesMap['Enum'],
|
||||
@ -265,7 +302,9 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
],
|
||||
DeviceType.DS: [
|
||||
FunctionModel(
|
||||
code: 'doorcontact_state', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
|
||||
code: 'doorcontact_state',
|
||||
type: functionTypesMap['Raw'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'battery_percentage',
|
||||
type: functionTypesMap['Integer'],
|
||||
@ -273,11 +312,14 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
],
|
||||
DeviceType.OneTouch: [
|
||||
FunctionModel(
|
||||
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'relay_status',
|
||||
type: functionTypesMap['Enum'],
|
||||
@ -299,17 +341,23 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
],
|
||||
DeviceType.TowTouch: [
|
||||
FunctionModel(
|
||||
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_2', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_2',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_2',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'relay_status',
|
||||
type: functionTypesMap['Enum'],
|
||||
@ -337,23 +385,32 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
],
|
||||
DeviceType.ThreeTouch: [
|
||||
FunctionModel(
|
||||
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_2', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_2',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_3', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_3',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_2',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_3',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'relay_status',
|
||||
type: functionTypesMap['Enum'],
|
||||
@ -387,19 +444,24 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
],
|
||||
DeviceType.GarageDoor: [
|
||||
FunctionModel(
|
||||
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'tr_timecon',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 120, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 120, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_alarm',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'door_control_1',
|
||||
type: functionTypesMap['Enum'],
|
||||
@ -420,19 +482,24 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
DeviceType.WaterLeak: [],
|
||||
DeviceType.PC: [
|
||||
FunctionModel(
|
||||
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_1',
|
||||
type: functionTypesMap['Boolean'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'countdown_1',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'tr_timecon',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 120, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 120, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'countdown_alarm',
|
||||
type: functionTypesMap['Integer'],
|
||||
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
|
||||
values: ValueModel.fromJson(
|
||||
{"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
|
||||
FunctionModel(
|
||||
code: 'door_control_1',
|
||||
type: functionTypesMap['Enum'],
|
||||
@ -476,9 +543,13 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
"range": ["scene"]
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'scene_id_group_id', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
|
||||
code: 'scene_id_group_id',
|
||||
type: functionTypesMap['Raw'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_backlight', type: functionTypesMap['Enum'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_backlight',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({})),
|
||||
],
|
||||
DeviceType.SixScene: [
|
||||
FunctionModel(
|
||||
@ -518,13 +589,19 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
|
||||
"range": ["scene"]
|
||||
})),
|
||||
FunctionModel(
|
||||
code: 'scene_id_group_id', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
|
||||
code: 'scene_id_group_id',
|
||||
type: functionTypesMap['Raw'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'switch_backlight', type: functionTypesMap['Enum'], values: ValueModel.fromJson({})),
|
||||
code: 'switch_backlight',
|
||||
type: functionTypesMap['Enum'],
|
||||
values: ValueModel.fromJson({})),
|
||||
],
|
||||
DeviceType.SOS: [
|
||||
FunctionModel(
|
||||
code: 'contact_state', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
|
||||
code: 'contact_state',
|
||||
type: functionTypesMap['Raw'],
|
||||
values: ValueModel.fromJson({})),
|
||||
FunctionModel(
|
||||
code: 'battery_percentage',
|
||||
type: functionTypesMap['Integer'],
|
||||
@ -709,16 +786,20 @@ List<Map<String, Object>> menuSections = [
|
||||
'title': 'Legal Information',
|
||||
'color': const Color(0xFF001B72),
|
||||
'buttons': [
|
||||
{'title': 'About', 'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsAbout, 'page': null},
|
||||
// {
|
||||
// 'title': 'Privacy Policy',
|
||||
// 'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsPrivacyPolicy,
|
||||
// 'page': null
|
||||
// },
|
||||
{
|
||||
'title': 'About',
|
||||
'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsAbout,
|
||||
'page': null
|
||||
},
|
||||
{
|
||||
'title': 'Privacy Policy',
|
||||
'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsPrivacyPolicy,
|
||||
'page': const PrivacyPolicy()
|
||||
},
|
||||
{
|
||||
'title': 'User Agreement',
|
||||
'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsUserAgreement,
|
||||
'page': null
|
||||
'page': const UserAgreement()
|
||||
},
|
||||
],
|
||||
},
|
||||
|
Reference in New Issue
Block a user