mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 20:24:55 +00:00
Hide nonfunctional widgets
This commit is contained in:
@ -55,7 +55,7 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
|
||||
Future fetchUserInfo() async {
|
||||
try {
|
||||
var uuid=await const FlutterSecureStorage().read(key: UserModel.userUuidKey);
|
||||
var uuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey);
|
||||
user = await ProfileApi().fetchUserInfo(uuid);
|
||||
emit(HomeUserInfoLoaded(user!)); // Emit state after fetching user info
|
||||
} catch (e) {
|
||||
@ -123,9 +123,7 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
return;
|
||||
}
|
||||
|
||||
var userUuid =
|
||||
await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ??
|
||||
'';
|
||||
var userUuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ?? '';
|
||||
if (userUuid.isNotEmpty) {
|
||||
await OneSignal.login(userUuid);
|
||||
}
|
||||
@ -221,8 +219,7 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
//////////////////////////////////////// API ////////////////////////////////////////
|
||||
generateInvitation(SpaceModel unit) async {
|
||||
try {
|
||||
final invitationCode =
|
||||
await SpacesAPI.generateInvitationCode(unit.id, unit.community.uuid);
|
||||
final invitationCode = await SpacesAPI.generateInvitationCode(unit.id, unit.community.uuid);
|
||||
if (invitationCode.isNotEmpty) {
|
||||
Share.share('The invitation code is $invitationCode');
|
||||
CustomSnackBar.displaySnackBar(
|
||||
@ -238,9 +235,7 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
|
||||
Future<bool> joinAUnit(String code) async {
|
||||
try {
|
||||
var userUuid =
|
||||
await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ??
|
||||
'';
|
||||
var userUuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ?? '';
|
||||
Map<String, String> body = {'inviteCode': code};
|
||||
|
||||
final success = await SpacesAPI.joinUnit(userUuid, body);
|
||||
@ -276,8 +271,7 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
fetchRoomsByUnitId(SpaceModel space) async {
|
||||
emitSafe(GetSpaceRoomsLoading());
|
||||
try {
|
||||
space.subspaces =
|
||||
await SpacesAPI.getSubSpaceBySpaceId(space.community.uuid, space.id);
|
||||
space.subspaces = await SpacesAPI.getSubSpaceBySpaceId(space.community.uuid, space.id);
|
||||
} catch (failure) {
|
||||
emitSafe(GetSpaceRoomsError(failure.toString()));
|
||||
return;
|
||||
@ -359,8 +353,7 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
size: 32,
|
||||
),
|
||||
style: ButtonStyle(
|
||||
foregroundColor:
|
||||
WidgetStateProperty.all(ColorsManager.textPrimaryColor),
|
||||
foregroundColor: WidgetStateProperty.all(ColorsManager.textPrimaryColor),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(
|
||||
@ -381,35 +374,34 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
NavigationService.navigatorKey.currentContext!
|
||||
.read<SmartSceneSelectBloc>()
|
||||
.add(const SmartSceneClearEvent());
|
||||
BlocProvider.of<EffectPeriodBloc>(
|
||||
NavigationService.navigatorKey.currentState!.context)
|
||||
BlocProvider.of<EffectPeriodBloc>(NavigationService.navigatorKey.currentState!.context)
|
||||
.add(ResetEffectivePeriod());
|
||||
NavigationService.navigatorKey.currentContext!
|
||||
.read<CreateSceneBloc>()
|
||||
.add(const ClearTabToRunSetting());
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.more_vert,
|
||||
size: 28,
|
||||
),
|
||||
style: ButtonStyle(
|
||||
foregroundColor:
|
||||
WidgetStateProperty.all(ColorsManager.textPrimaryColor),
|
||||
),
|
||||
onPressed: () {},
|
||||
),
|
||||
// IconButton(
|
||||
// icon: const Icon(
|
||||
// Icons.more_vert,
|
||||
// size: 28,
|
||||
// ),
|
||||
// style: ButtonStyle(
|
||||
// foregroundColor:
|
||||
// WidgetStateProperty.all(ColorsManager.textPrimaryColor),
|
||||
// ),
|
||||
// onPressed: () {},
|
||||
// ),
|
||||
],
|
||||
'Menu': [
|
||||
IconButton(
|
||||
icon: SvgPicture.asset(
|
||||
Assets.assetsIconsScan,
|
||||
height: 20,
|
||||
width: 20,
|
||||
),
|
||||
onPressed: () {},
|
||||
),
|
||||
// IconButton(
|
||||
// icon: SvgPicture.asset(
|
||||
// Assets.assetsIconsScan,
|
||||
// height: 20,
|
||||
// width: 20,
|
||||
// ),
|
||||
// onPressed: () {},
|
||||
// ),
|
||||
],
|
||||
};
|
||||
|
||||
@ -429,8 +421,7 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
};
|
||||
|
||||
static var bottomNavItems = [
|
||||
defaultBottomNavBarItem(
|
||||
icon: Assets.assetsIconsDashboard, label: 'Dashboard'),
|
||||
defaultBottomNavBarItem(icon: Assets.assetsIconsDashboard, label: 'Dashboard'),
|
||||
// defaultBottomNavBarItem(icon: Assets.assetsIconslayout, label: 'Layout'),
|
||||
defaultBottomNavBarItem(icon: Assets.assetsIconsDevices, label: 'Devices'),
|
||||
defaultBottomNavBarItem(icon: Assets.assetsIconsRoutines, label: 'Routine'),
|
||||
@ -456,8 +447,7 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
|
||||
void updateDevice(String deviceId) async {
|
||||
try {
|
||||
final response = await DevicesAPI.firmwareDevice(
|
||||
deviceId: deviceId, firmwareVersion: '0');
|
||||
final response = await DevicesAPI.firmwareDevice(deviceId: deviceId, firmwareVersion: '0');
|
||||
if (response['success'] ?? false) {
|
||||
CustomSnackBar.displaySnackBar('No updates available');
|
||||
}
|
||||
@ -465,8 +455,7 @@ class HomeCubit extends Cubit<HomeState> {
|
||||
}
|
||||
}
|
||||
|
||||
BottomNavigationBarItem defaultBottomNavBarItem(
|
||||
{required String icon, required String label}) {
|
||||
BottomNavigationBarItem defaultBottomNavBarItem({required String icon, required String label}) {
|
||||
return BottomNavigationBarItem(
|
||||
icon: SvgPicture.asset(icon),
|
||||
activeIcon: SvgPicture.asset(
|
||||
|
||||
@ -31,8 +31,7 @@ class LoginView extends StatelessWidget {
|
||||
// content: Text(state.message),
|
||||
// ),
|
||||
// );
|
||||
}
|
||||
else if (state is AuthLoginSuccess) {
|
||||
} else if (state is AuthLoginSuccess) {
|
||||
Navigator.popAndPushNamed(context, Routes.homeRoute);
|
||||
}
|
||||
},
|
||||
@ -96,8 +95,8 @@ class LoginView extends StatelessWidget {
|
||||
height: 20,
|
||||
),
|
||||
const LoginForm(),
|
||||
const LoginDivider(),
|
||||
const LoginWithGoogleFacebook(),
|
||||
// const LoginDivider(),
|
||||
// const LoginWithGoogleFacebook(),
|
||||
const DontHaveAnAccount(),
|
||||
],
|
||||
),
|
||||
|
||||
@ -38,10 +38,8 @@ class SettingProfilePage extends StatelessWidget {
|
||||
final _bloc = BlocProvider.of<DeviceSettingBloc>(context);
|
||||
return state is DeviceSettingLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: CircularProgressIndicator()),
|
||||
child:
|
||||
DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
@ -57,18 +55,15 @@ class SettingProfilePage extends StatelessWidget {
|
||||
child: SvgPicture.asset(
|
||||
Assets.sosHomeIcon,
|
||||
fit: BoxFit.fitHeight,
|
||||
height:
|
||||
MediaQuery.of(context).size.height * 0.13,
|
||||
height: MediaQuery.of(context).size.height * 0.13,
|
||||
))
|
||||
: CircleAvatar(
|
||||
radius: 55,
|
||||
backgroundColor: ColorsManager.graysColor,
|
||||
child: ClipOval(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child: SvgPicture.asset(
|
||||
@ -76,10 +71,7 @@ class SettingProfilePage extends StatelessWidget {
|
||||
? Assets.fourSceneIcon
|
||||
: Assets.sixSceneIcon,
|
||||
fit: BoxFit.contain,
|
||||
height: MediaQuery.of(context)
|
||||
.size
|
||||
.height *
|
||||
0.08,
|
||||
height: MediaQuery.of(context).size.height * 0.08,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -97,8 +89,7 @@ class SettingProfilePage extends StatelessWidget {
|
||||
children: [
|
||||
IntrinsicWidth(
|
||||
child: ConstrainedBox(
|
||||
constraints:
|
||||
const BoxConstraints(maxWidth: 200),
|
||||
constraints: const BoxConstraints(maxWidth: 200),
|
||||
child: TextFormField(
|
||||
maxLength: 30,
|
||||
style: const TextStyle(
|
||||
@ -131,8 +122,7 @@ class SettingProfilePage extends StatelessWidget {
|
||||
Assets.sosEditProfile,
|
||||
color: Colors.grey,
|
||||
fit: BoxFit.contain,
|
||||
height: MediaQuery.of(context).size.height *
|
||||
0.02,
|
||||
height: MediaQuery.of(context).size.height * 0.02,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -151,14 +141,14 @@ class SettingProfilePage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
bool val = await Navigator.of(context).push(
|
||||
bool? val = await Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => LocationSettingPage(
|
||||
space: spaces!.first,
|
||||
deviceId: device?.uuid ?? '',
|
||||
)),
|
||||
);
|
||||
if (val == true) {
|
||||
if (val != null && val == true) {
|
||||
_bloc.add(const DeviceSettingInitialInfo());
|
||||
}
|
||||
},
|
||||
@ -172,8 +162,7 @@ class SettingProfilePage extends StatelessWidget {
|
||||
children: [
|
||||
SizedBox(
|
||||
child: BodyMedium(
|
||||
text: _bloc
|
||||
.deviceInfo.subspace.subspaceName,
|
||||
text: _bloc.deviceInfo.subspace.subspaceName,
|
||||
fontColor: ColorsManager.textGray,
|
||||
),
|
||||
),
|
||||
|
||||
@ -40,10 +40,8 @@ class SettingsPage extends StatelessWidget {
|
||||
|
||||
return state is DeviceSettingLoadingState
|
||||
? const Center(
|
||||
child: DefaultContainer(
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: CircularProgressIndicator()),
|
||||
child:
|
||||
DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
|
||||
)
|
||||
: ListView(
|
||||
children: [
|
||||
@ -71,31 +69,25 @@ class SettingsPage extends StatelessWidget {
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
DefaultContainer(
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(30)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(30)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 90),
|
||||
padding: const EdgeInsets.only(left: 90),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
child: Text(
|
||||
_bloc.deviceInfo.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight:
|
||||
FontWeight.w700,
|
||||
color: ColorsManager
|
||||
.grayColor,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: ColorsManager.grayColor,
|
||||
),
|
||||
overflow: TextOverflow
|
||||
.ellipsis, // Adds ellipsis (...) when the text overflows.
|
||||
@ -106,10 +98,7 @@ class SettingsPage extends StatelessWidget {
|
||||
height: 5,
|
||||
),
|
||||
BodySmall(
|
||||
text: _bloc
|
||||
.deviceInfo
|
||||
.subspace
|
||||
.subspaceName),
|
||||
text: _bloc.deviceInfo.subspace.subspaceName),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -136,13 +125,10 @@ class SettingsPage extends StatelessWidget {
|
||||
backgroundColor: Colors.white,
|
||||
child: CircleAvatar(
|
||||
radius: 40,
|
||||
backgroundColor:
|
||||
ColorsManager.backgroundColor,
|
||||
backgroundColor: ColorsManager.backgroundColor,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
device!.type == "SOS"
|
||||
? ClipOval(
|
||||
@ -153,20 +139,15 @@ class SettingsPage extends StatelessWidget {
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: device!.type ==
|
||||
"4S"
|
||||
? const EdgeInsets.only(
|
||||
top: 5)
|
||||
: const EdgeInsets.only(
|
||||
top: 0),
|
||||
padding: device!.type == "4S"
|
||||
? const EdgeInsets.only(top: 5)
|
||||
: const EdgeInsets.only(top: 0),
|
||||
child: SizedBox(
|
||||
height: 70,
|
||||
child: SvgPicture.asset(
|
||||
device!.type == "4S"
|
||||
? Assets
|
||||
.fourSceneIcon
|
||||
: Assets
|
||||
.sixSceneIcon,
|
||||
? Assets.fourSceneIcon
|
||||
: Assets.sixSceneIcon,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
@ -221,114 +202,114 @@ class SettingsPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const BodyMedium(
|
||||
text: 'Device Offline Notification',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 12,
|
||||
fontColor: ColorsManager.grayColor,
|
||||
),
|
||||
DefaultContainer(
|
||||
child: Column(
|
||||
children: [
|
||||
SettingWidget(
|
||||
value: _bloc.enableAlarm,
|
||||
onChanged: (p0) {
|
||||
context
|
||||
.read<DeviceSettingBloc>()
|
||||
.add(ToggleEnableAlarmEvent(p0));
|
||||
},
|
||||
isNotification: true,
|
||||
onTap: () {},
|
||||
text: 'Offline Notification',
|
||||
icon: Assets.notificationIcon,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const BodyMedium(
|
||||
text: 'Others',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 12,
|
||||
fontColor: ColorsManager.grayColor,
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
DefaultContainer(
|
||||
child: Column(
|
||||
children: [
|
||||
SettingWidget(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
ShareDevicePage(device: device!)),
|
||||
);
|
||||
},
|
||||
text: 'Share Device',
|
||||
icon: Assets.shareIcon,
|
||||
),
|
||||
// const Divider(
|
||||
// color: ColorsManager.dividerColor,
|
||||
// ),
|
||||
// SettingWidget(
|
||||
// onTap: () {
|
||||
// Navigator.of(context).push(
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) =>
|
||||
// FourSceneCreateGroup(
|
||||
// device: device!)),
|
||||
// );
|
||||
// },
|
||||
// text: 'Create Group',
|
||||
// icon: Assets.createGroupIcon,
|
||||
// ),
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
SettingWidget(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
FaqSettingPage(device: device!)),
|
||||
);
|
||||
},
|
||||
text: 'Device FAQ',
|
||||
icon: Assets.faqIcon,
|
||||
),
|
||||
const Divider(
|
||||
color: ColorsManager.dividerColor,
|
||||
),
|
||||
SettingWidget(
|
||||
onTapUpdate: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return UpdateInfoDialog(
|
||||
cancelTab: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
confirmTab: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
isUpdate: true,
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const UpdatePageSetting()),
|
||||
);
|
||||
},
|
||||
text: 'Device Update',
|
||||
icon: Assets.updateIcon,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// const BodyMedium(
|
||||
// text: 'Device Offline Notification',
|
||||
// fontWeight: FontWeight.w700,
|
||||
// fontSize: 12,
|
||||
// fontColor: ColorsManager.grayColor,
|
||||
// ),
|
||||
// DefaultContainer(
|
||||
// child: Column(
|
||||
// children: [
|
||||
// SettingWidget(
|
||||
// value: _bloc.enableAlarm,
|
||||
// onChanged: (p0) {
|
||||
// context
|
||||
// .read<DeviceSettingBloc>()
|
||||
// .add(ToggleEnableAlarmEvent(p0));
|
||||
// },
|
||||
// isNotification: true,
|
||||
// onTap: () {},
|
||||
// text: 'Offline Notification',
|
||||
// icon: Assets.notificationIcon,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(height: 20),
|
||||
// const BodyMedium(
|
||||
// text: 'Others',
|
||||
// fontWeight: FontWeight.w700,
|
||||
// fontSize: 12,
|
||||
// fontColor: ColorsManager.grayColor,
|
||||
// ),
|
||||
// const SizedBox(height: 5),
|
||||
// DefaultContainer(
|
||||
// child: Column(
|
||||
// children: [
|
||||
// SettingWidget(
|
||||
// onTap: () {
|
||||
// Navigator.of(context).push(
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) =>
|
||||
// ShareDevicePage(device: device!)),
|
||||
// );
|
||||
// },
|
||||
// text: 'Share Device',
|
||||
// icon: Assets.shareIcon,
|
||||
// ),
|
||||
// // const Divider(
|
||||
// // color: ColorsManager.dividerColor,
|
||||
// // ),
|
||||
// // SettingWidget(
|
||||
// // onTap: () {
|
||||
// // Navigator.of(context).push(
|
||||
// // MaterialPageRoute(
|
||||
// // builder: (context) =>
|
||||
// // FourSceneCreateGroup(
|
||||
// // device: device!)),
|
||||
// // );
|
||||
// // },
|
||||
// // text: 'Create Group',
|
||||
// // icon: Assets.createGroupIcon,
|
||||
// // ),
|
||||
// const Divider(
|
||||
// color: ColorsManager.dividerColor,
|
||||
// ),
|
||||
// SettingWidget(
|
||||
// onTap: () {
|
||||
// Navigator.of(context).push(
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) =>
|
||||
// FaqSettingPage(device: device!)),
|
||||
// );
|
||||
// },
|
||||
// text: 'Device FAQ',
|
||||
// icon: Assets.faqIcon,
|
||||
// ),
|
||||
// const Divider(
|
||||
// color: ColorsManager.dividerColor,
|
||||
// ),
|
||||
// SettingWidget(
|
||||
// onTapUpdate: () {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return UpdateInfoDialog(
|
||||
// cancelTab: () {
|
||||
// Navigator.of(context).pop();
|
||||
// },
|
||||
// confirmTab: () {
|
||||
// Navigator.of(context).pop();
|
||||
// },
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// },
|
||||
// isUpdate: true,
|
||||
// onTap: () {
|
||||
// Navigator.of(context).push(
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) =>
|
||||
// const UpdatePageSetting()),
|
||||
// );
|
||||
// },
|
||||
// text: 'Device Update',
|
||||
// icon: Assets.updateIcon,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
const SizedBox(height: 20),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
@ -356,8 +337,7 @@ class SettingsPage extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
@ -379,8 +359,7 @@ class SettingsPage extends StatelessWidget {
|
||||
text: 'Disconnect Device',
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 15,
|
||||
fontColor:
|
||||
ColorsManager.textPrimaryColor,
|
||||
fontColor: ColorsManager.textPrimaryColor,
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
@ -391,8 +370,7 @@ class SettingsPage extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
@ -404,20 +382,17 @@ class SettingsPage extends StatelessWidget {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
confirmTab: () {
|
||||
_bloc.add(
|
||||
DeleteDeviceEvent());
|
||||
_bloc.add(DeleteDeviceEvent());
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
child: const BodyMedium(
|
||||
text:
|
||||
'Disconnect Device and Wipe Data',
|
||||
text: 'Disconnect Device and Wipe Data',
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 15,
|
||||
fontColor:
|
||||
ColorsManager.textPrimaryColor,
|
||||
fontColor: ColorsManager.textPrimaryColor,
|
||||
),
|
||||
),
|
||||
const Icon(
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
||||
import 'package:syncrow_app/features/devices/view/widgets/popup_menu_widget.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/font_manager.dart';
|
||||
@ -24,19 +22,19 @@ class DeviceAppbar extends StatelessWidget implements PreferredSizeWidget {
|
||||
fontWeight: FontsManager.bold,
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
showPopupMenu(context: context, items: [
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
HomeCubit.getInstance().updateDevice(deviceUuid);
|
||||
},
|
||||
value: 'Update',
|
||||
child: const Text('Update'),
|
||||
)
|
||||
]);
|
||||
},
|
||||
icon: Icon(Icons.edit))
|
||||
// IconButton(
|
||||
// onPressed: () {
|
||||
// showPopupMenu(context: context, items: [
|
||||
// PopupMenuItem(
|
||||
// onTap: () async {
|
||||
// HomeCubit.getInstance().updateDevice(deviceUuid);
|
||||
// },
|
||||
// value: 'Update',
|
||||
// child: const Text('Update'),
|
||||
// )
|
||||
// ]);
|
||||
// },
|
||||
// icon: Icon(Icons.edit))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -8,9 +8,7 @@ import 'package:syncrow_app/features/devices/bloc/sos_bloc/sos_state.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_report_model.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class SosRecordsScreen extends StatefulWidget {
|
||||
@ -22,14 +20,13 @@ class SosRecordsScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SosRecordsScreenState extends State<SosRecordsScreen> {
|
||||
int _selectedIndex = 0;
|
||||
// int _selectedIndex = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultScaffold(
|
||||
title: 'Records',
|
||||
child: BlocProvider(
|
||||
create: (context) =>
|
||||
SosBloc(sosId: widget.sosId)..add(const ReportLogsInitial()),
|
||||
create: (context) => SosBloc(sosId: widget.sosId)..add(const ReportLogsInitial()),
|
||||
child: BlocBuilder<SosBloc, SosState>(
|
||||
builder: (context, state) {
|
||||
final waterSensorBloc = BlocProvider.of<SosBloc>(context);
|
||||
@ -37,15 +34,13 @@ class _SosRecordsScreenState extends State<SosRecordsScreen> {
|
||||
|
||||
if (state is LoadingNewSate) {
|
||||
return const Center(
|
||||
child: DefaultContainer(
|
||||
width: 50, height: 50, child: CircularProgressIndicator()),
|
||||
child: DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
|
||||
);
|
||||
} else if (state is UpdateState) {
|
||||
for (var record in waterSensorBloc.recordGroups.data!) {
|
||||
final DateTime eventDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(record.eventTime!);
|
||||
final String formattedDate =
|
||||
DateFormat('EEEE, dd/MM/yyyy').format(eventDateTime);
|
||||
final String formattedDate = DateFormat('EEEE, dd/MM/yyyy').format(eventDateTime);
|
||||
if (groupedRecords.containsKey(formattedDate)) {
|
||||
groupedRecords[formattedDate]!.add(record);
|
||||
} else {
|
||||
@ -58,63 +53,61 @@ class _SosRecordsScreenState extends State<SosRecordsScreen> {
|
||||
length: 2,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: const ShapeDecoration(
|
||||
color: ColorsManager.onPrimaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
),
|
||||
),
|
||||
child: TabBar(
|
||||
onTap: (value) {
|
||||
setState(() {
|
||||
_selectedIndex = value;
|
||||
});
|
||||
},
|
||||
indicatorColor: Colors.white,
|
||||
dividerHeight: 0,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
indicator: const ShapeDecoration(
|
||||
color: ColorsManager.slidingBlueColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
),
|
||||
tabs: [
|
||||
Tab(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: BodySmall(
|
||||
text: 'Record',
|
||||
style: context.bodySmall.copyWith(
|
||||
color: _selectedIndex == 0
|
||||
? Colors.white
|
||||
: ColorsManager.blackColor,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Tab(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Text(
|
||||
'Automation Log',
|
||||
style: context.bodySmall.copyWith(
|
||||
color: _selectedIndex == 1
|
||||
? Colors.white
|
||||
: ColorsManager.blackColor,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Container(
|
||||
// width: MediaQuery.of(context).size.width,
|
||||
// decoration: const ShapeDecoration(
|
||||
// color: ColorsManager.onPrimaryColor,
|
||||
// shape: RoundedRectangleBorder(
|
||||
// borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
// ),
|
||||
// ),
|
||||
// child: TabBar(
|
||||
// onTap: (value) {
|
||||
// setState(() {
|
||||
// _selectedIndex = value;
|
||||
// });
|
||||
// },
|
||||
// indicatorColor: Colors.white,
|
||||
// dividerHeight: 0,
|
||||
// indicatorSize: TabBarIndicatorSize.tab,
|
||||
// indicator: const ShapeDecoration(
|
||||
// color: ColorsManager.slidingBlueColor,
|
||||
// shape: RoundedRectangleBorder(
|
||||
// borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
// ),
|
||||
// ),
|
||||
// tabs: [
|
||||
// Tab(
|
||||
// child: Container(
|
||||
// padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
// child: BodySmall(
|
||||
// text: 'Record',
|
||||
// style: context.bodySmall.copyWith(
|
||||
// color:
|
||||
// _selectedIndex == 0 ? Colors.white : ColorsManager.blackColor,
|
||||
// fontSize: 12,
|
||||
// fontWeight: FontWeight.w400,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Tab(
|
||||
// child: Container(
|
||||
// padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
// child: Text(
|
||||
// 'Automation Log',
|
||||
// style: context.bodySmall.copyWith(
|
||||
// color:
|
||||
// _selectedIndex == 1 ? Colors.white : ColorsManager.blackColor,
|
||||
// fontSize: 12,
|
||||
// fontWeight: FontWeight.w400,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
@ -129,14 +122,11 @@ class _SosRecordsScreenState extends State<SosRecordsScreen> {
|
||||
: ListView.builder(
|
||||
itemCount: groupedRecords.length,
|
||||
itemBuilder: (context, index) {
|
||||
final String date =
|
||||
groupedRecords.keys.elementAt(index);
|
||||
final List<DeviceEvent> recordsForDate =
|
||||
groupedRecords[date]!;
|
||||
final String date = groupedRecords.keys.elementAt(index);
|
||||
final List<DeviceEvent> recordsForDate = groupedRecords[date]!;
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
@ -152,49 +142,37 @@ class _SosRecordsScreenState extends State<SosRecordsScreen> {
|
||||
DefaultContainer(
|
||||
child: Column(
|
||||
children: [
|
||||
...recordsForDate
|
||||
.asMap()
|
||||
.entries
|
||||
.map((entry) {
|
||||
...recordsForDate.asMap().entries.map((entry) {
|
||||
final int idx = entry.key;
|
||||
final DeviceEvent record =
|
||||
entry.value;
|
||||
final DeviceEvent record = entry.value;
|
||||
final DateTime eventDateTime =
|
||||
DateTime
|
||||
.fromMillisecondsSinceEpoch(
|
||||
record.eventTime!);
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
record.eventTime!);
|
||||
final String formattedTime =
|
||||
DateFormat('HH:mm:ss')
|
||||
.format(eventDateTime);
|
||||
DateFormat('HH:mm:ss').format(eventDateTime);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
ListTile(
|
||||
leading: SvgPicture.asset(
|
||||
record.value == 'true'
|
||||
? Assets
|
||||
.leakDetectedIcon
|
||||
: Assets
|
||||
.leakNormalIcon,
|
||||
? Assets.leakDetectedIcon
|
||||
: Assets.leakNormalIcon,
|
||||
height: 25,
|
||||
width: 25,
|
||||
),
|
||||
title: const Text(
|
||||
"SOS Alert Triggered",
|
||||
style: const TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
subtitle:
|
||||
Text(formattedTime),
|
||||
subtitle: Text(formattedTime),
|
||||
),
|
||||
if (idx !=
|
||||
recordsForDate.length - 1)
|
||||
if (idx != recordsForDate.length - 1)
|
||||
const Divider(
|
||||
color: ColorsManager
|
||||
.graysColor,
|
||||
color: ColorsManager.graysColor,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@ -8,9 +8,7 @@ import 'package:syncrow_app/features/devices/bloc/water_leak_bloc/water_leak_sta
|
||||
import 'package:syncrow_app/features/devices/model/device_report_model.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class WaterLeakRecordsScreen extends StatefulWidget {
|
||||
@ -22,14 +20,13 @@ class WaterLeakRecordsScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
|
||||
int _selectedIndex = 0;
|
||||
// int _selectedIndex = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultScaffold(
|
||||
title: 'Records',
|
||||
child: BlocProvider(
|
||||
create: (context) =>
|
||||
WaterLeakBloc(WLId: widget.WLId)..add(const ReportLogsInitial()),
|
||||
create: (context) => WaterLeakBloc(WLId: widget.WLId)..add(const ReportLogsInitial()),
|
||||
child: BlocBuilder<WaterLeakBloc, WaterLeakState>(
|
||||
builder: (context, state) {
|
||||
final waterSensorBloc = BlocProvider.of<WaterLeakBloc>(context);
|
||||
@ -37,15 +34,13 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
|
||||
|
||||
if (state is WaterLeakLoadingState) {
|
||||
return const Center(
|
||||
child: DefaultContainer(
|
||||
width: 50, height: 50, child: CircularProgressIndicator()),
|
||||
child: DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
|
||||
);
|
||||
} else if (state is UpdateState) {
|
||||
for (var record in waterSensorBloc.recordGroups.data!) {
|
||||
final DateTime eventDateTime =
|
||||
DateTime.fromMillisecondsSinceEpoch(record.eventTime!);
|
||||
final String formattedDate =
|
||||
DateFormat('EEEE, dd/MM/yyyy').format(eventDateTime);
|
||||
final String formattedDate = DateFormat('EEEE, dd/MM/yyyy').format(eventDateTime);
|
||||
|
||||
if (groupedRecords.containsKey(formattedDate)) {
|
||||
groupedRecords[formattedDate]!.add(record);
|
||||
@ -59,63 +54,63 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
|
||||
length: 2,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: const ShapeDecoration(
|
||||
color: ColorsManager.onPrimaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
),
|
||||
),
|
||||
child: TabBar(
|
||||
onTap: (value) {
|
||||
setState(() {
|
||||
_selectedIndex = value;
|
||||
});
|
||||
},
|
||||
indicatorColor: Colors.white,
|
||||
dividerHeight: 0,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
indicator: const ShapeDecoration(
|
||||
color: ColorsManager.slidingBlueColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
),
|
||||
tabs: [
|
||||
Tab(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: BodySmall(
|
||||
text: 'Record',
|
||||
style: context.bodySmall.copyWith(
|
||||
color: _selectedIndex == 0
|
||||
? Colors.white
|
||||
: ColorsManager.blackColor,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Tab(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Text(
|
||||
'Automation Record',
|
||||
style: context.bodySmall.copyWith(
|
||||
color: _selectedIndex == 1
|
||||
? Colors.white
|
||||
: ColorsManager.blackColor,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Container(
|
||||
// width: MediaQuery.of(context).size.width,
|
||||
// decoration: const ShapeDecoration(
|
||||
// color: ColorsManager.onPrimaryColor,
|
||||
// shape: RoundedRectangleBorder(
|
||||
// borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
// ),
|
||||
// ),
|
||||
// child: TabBar(
|
||||
// onTap: (value) {
|
||||
// setState(() {
|
||||
// _selectedIndex = value;
|
||||
// });
|
||||
// },
|
||||
// indicatorColor: Colors.white,
|
||||
// dividerHeight: 0,
|
||||
// indicatorSize: TabBarIndicatorSize.tab,
|
||||
// indicator: const ShapeDecoration(
|
||||
// color: ColorsManager.slidingBlueColor,
|
||||
// shape: RoundedRectangleBorder(
|
||||
// borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
// ),
|
||||
// ),
|
||||
// tabs: [
|
||||
// Tab(
|
||||
// child: Container(
|
||||
// padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
// child: BodySmall(
|
||||
// text: 'Record',
|
||||
// style: context.bodySmall.copyWith(
|
||||
// color: _selectedIndex == 0
|
||||
// ? Colors.white
|
||||
// : ColorsManager.blackColor,
|
||||
// fontSize: 12,
|
||||
// fontWeight: FontWeight.w400,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Tab(
|
||||
// child: Container(
|
||||
// padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
// child: Text(
|
||||
// 'Automation Record',
|
||||
// style: context.bodySmall.copyWith(
|
||||
// color: _selectedIndex == 1
|
||||
// ? Colors.white
|
||||
// : ColorsManager.blackColor,
|
||||
// fontSize: 12,
|
||||
// fontWeight: FontWeight.w400,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
@ -125,14 +120,11 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
|
||||
: ListView.builder(
|
||||
itemCount: groupedRecords.length,
|
||||
itemBuilder: (context, index) {
|
||||
final String date =
|
||||
groupedRecords.keys.elementAt(index);
|
||||
final List<DeviceEvent> recordsForDate =
|
||||
groupedRecords[date]!;
|
||||
final String date = groupedRecords.keys.elementAt(index);
|
||||
final List<DeviceEvent> recordsForDate = groupedRecords[date]!;
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
@ -148,30 +140,22 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
|
||||
DefaultContainer(
|
||||
child: Column(
|
||||
children: [
|
||||
...recordsForDate
|
||||
.asMap()
|
||||
.entries
|
||||
.map((entry) {
|
||||
...recordsForDate.asMap().entries.map((entry) {
|
||||
final int idx = entry.key;
|
||||
final DeviceEvent record =
|
||||
entry.value;
|
||||
final DeviceEvent record = entry.value;
|
||||
final DateTime eventDateTime =
|
||||
DateTime
|
||||
.fromMillisecondsSinceEpoch(
|
||||
record.eventTime!);
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
record.eventTime!);
|
||||
final String formattedTime =
|
||||
DateFormat('HH:mm:ss')
|
||||
.format(eventDateTime);
|
||||
DateFormat('HH:mm:ss').format(eventDateTime);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
ListTile(
|
||||
leading: SvgPicture.asset(
|
||||
record.value == 'true'
|
||||
? Assets
|
||||
.leakDetectedIcon
|
||||
: Assets
|
||||
.leakNormalIcon,
|
||||
? Assets.leakDetectedIcon
|
||||
: Assets.leakNormalIcon,
|
||||
height: 25,
|
||||
width: 25,
|
||||
),
|
||||
@ -180,19 +164,15 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
|
||||
? "Leak Detected"
|
||||
: "Normal",
|
||||
style: const TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
subtitle:
|
||||
Text('$formattedTime'),
|
||||
subtitle: Text('$formattedTime'),
|
||||
),
|
||||
if (idx !=
|
||||
recordsForDate.length - 1)
|
||||
if (idx != recordsForDate.length - 1)
|
||||
const Divider(
|
||||
color: ColorsManager
|
||||
.graysColor,
|
||||
color: ColorsManager.graysColor,
|
||||
),
|
||||
],
|
||||
);
|
||||
@ -207,8 +187,7 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
|
||||
Container(
|
||||
height: 10,
|
||||
width: 20,
|
||||
child:
|
||||
const Center(child: Text('No data available.')),
|
||||
child: const Center(child: Text('No data available.')),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@ -80,30 +80,30 @@ class HomeSettingsView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
//Divider
|
||||
Container(
|
||||
height: 1,
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const BodyMedium(text: 'Location'),
|
||||
Flexible(
|
||||
child: TextField(
|
||||
textAlign: TextAlign.end,
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Set',
|
||||
hintStyle: context.bodyMedium.copyWith(color: Colors.grey),
|
||||
border: InputBorder.none,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// Container(
|
||||
// height: 1,
|
||||
// margin: const EdgeInsets.only(top: 10),
|
||||
// color: ColorsManager.greyColor,
|
||||
// ),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// const BodyMedium(text: 'Location'),
|
||||
// Flexible(
|
||||
// child: TextField(
|
||||
// textAlign: TextAlign.end,
|
||||
// decoration: InputDecoration(
|
||||
// hintText: 'Set',
|
||||
// hintStyle: context.bodyMedium.copyWith(color: Colors.grey),
|
||||
// border: InputBorder.none,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
//Divider
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
margin: const EdgeInsets.symmetric(vertical: 10),
|
||||
height: 1,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
@ -135,77 +135,77 @@ class HomeSettingsView extends StatelessWidget {
|
||||
height: 10,
|
||||
),
|
||||
//TODO connect the members to this GridView
|
||||
const BodySmall(
|
||||
text: "Members",
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
GridView.builder(
|
||||
shrinkWrap: true,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 10,
|
||||
),
|
||||
itemCount: 2,
|
||||
itemBuilder: (context, index) => Stack(
|
||||
alignment: Alignment.topCenter,
|
||||
children: [
|
||||
DefaultContainer(
|
||||
margin: const EdgeInsets.only(top: 20),
|
||||
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 40),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
BodyMedium(
|
||||
text: 'Member ${index + 1}',
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
const BodySmall(
|
||||
text: 'Syncrow Account',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox.square(
|
||||
dimension: 80,
|
||||
child: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
child: SizedBox.square(
|
||||
dimension: 77,
|
||||
child: CircleAvatar(
|
||||
backgroundColor: ColorsManager.greyColor,
|
||||
child: Icon(Icons.person),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: DefaultContainer(
|
||||
child: Center(
|
||||
child: BodyLarge(
|
||||
text: 'Leave Home',
|
||||
style: context.bodyLarge.copyWith(
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
// const BodySmall(
|
||||
// text: "Members",
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// GridView.builder(
|
||||
// shrinkWrap: true,
|
||||
// gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
// crossAxisCount: 2,
|
||||
// crossAxisSpacing: 10,
|
||||
// ),
|
||||
// itemCount: 2,
|
||||
// itemBuilder: (context, index) => Stack(
|
||||
// alignment: Alignment.topCenter,
|
||||
// children: [
|
||||
// DefaultContainer(
|
||||
// margin: const EdgeInsets.only(top: 20),
|
||||
// padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 40),
|
||||
// child: Column(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// children: [
|
||||
// const SizedBox(
|
||||
// height: 50,
|
||||
// ),
|
||||
// BodyMedium(
|
||||
// text: 'Member ${index + 1}',
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// const SizedBox(height: 3),
|
||||
// const BodySmall(
|
||||
// text: 'Syncrow Account',
|
||||
// textAlign: TextAlign.center,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox.square(
|
||||
// dimension: 80,
|
||||
// child: CircleAvatar(
|
||||
// backgroundColor: Colors.white,
|
||||
// child: SizedBox.square(
|
||||
// dimension: 77,
|
||||
// child: CircleAvatar(
|
||||
// backgroundColor: ColorsManager.greyColor,
|
||||
// child: Icon(Icons.person),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// const Spacer(),
|
||||
// InkWell(
|
||||
// onTap: () {},
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: DefaultContainer(
|
||||
// child: Center(
|
||||
// child: BodyLarge(
|
||||
// text: 'Leave Home',
|
||||
// style: context.bodyLarge.copyWith(
|
||||
// color: Colors.red,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@ -4,8 +4,8 @@ import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/profile_bloc/profile_bloc.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/profile_bloc/profile_event.dart';
|
||||
import 'package:syncrow_app/features/menu/bloc/profile_bloc/profile_state.dart';
|
||||
import 'package:syncrow_app/features/menu/view/widgets/profile/region_page.dart';
|
||||
import 'package:syncrow_app/features/menu/view/widgets/profile/time_zone_screen_page.dart';
|
||||
// import 'package:syncrow_app/features/menu/view/widgets/profile/region_page.dart';
|
||||
// import 'package:syncrow_app/features/menu/view/widgets/profile/time_zone_screen_page.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
@ -134,65 +134,65 @@ class ProfileView extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 1,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
profileBloc.add(const ChangeNameEvent(value: false));
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const RegionPage(),
|
||||
),
|
||||
).then((result) {
|
||||
profileBloc.add(InitialProfileEvent());
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 20, bottom: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const BodyMedium(text: 'Region '),
|
||||
Flexible(
|
||||
child: BodyMedium(
|
||||
text: HomeCubit.user!.regionName ?? 'No Region')),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 1,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
profileBloc.add(const ChangeNameEvent(value: false));
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const TimeZoneScreenPage(),
|
||||
),
|
||||
).then((result) {
|
||||
profileBloc.add(InitialProfileEvent());
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const BodyMedium(text: 'Time Zone '),
|
||||
Flexible(
|
||||
child: BodyMedium(
|
||||
text: HomeCubit.user!.timeZone ?? "No Time Zone"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// Container(
|
||||
// height: 1,
|
||||
// color: ColorsManager.greyColor,
|
||||
// ),
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// profileBloc.add(const ChangeNameEvent(value: false));
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => const RegionPage(),
|
||||
// ),
|
||||
// ).then((result) {
|
||||
// profileBloc.add(InitialProfileEvent());
|
||||
// });
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.only(top: 20, bottom: 20),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// const BodyMedium(text: 'Region '),
|
||||
// Flexible(
|
||||
// child: BodyMedium(
|
||||
// text: HomeCubit.user!.regionName ?? 'No Region')),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Container(
|
||||
// height: 1,
|
||||
// color: ColorsManager.greyColor,
|
||||
// ),
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// profileBloc.add(const ChangeNameEvent(value: false));
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => const TimeZoneScreenPage(),
|
||||
// ),
|
||||
// ).then((result) {
|
||||
// profileBloc.add(InitialProfileEvent());
|
||||
// });
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// const BodyMedium(text: 'Time Zone '),
|
||||
// Flexible(
|
||||
// child: BodyMedium(
|
||||
// text: HomeCubit.user!.timeZone ?? "No Time Zone"),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)),
|
||||
],
|
||||
|
||||
@ -10,7 +10,7 @@ class SecurtyView extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultScaffold(
|
||||
title: 'Securty',
|
||||
title: 'Security',
|
||||
child: Column(
|
||||
children: [
|
||||
DefaultContainer(
|
||||
@ -24,11 +24,11 @@ class SecurtyView extends StatelessWidget {
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Column(
|
||||
child: const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Row(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BodyMedium(
|
||||
@ -41,111 +41,111 @@ class SecurtyView extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 15),
|
||||
height: 1,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BodyMedium(
|
||||
text: 'App Lock',
|
||||
),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: ColorsManager.greyColor,
|
||||
size: 15,
|
||||
)
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 15),
|
||||
height: 1,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BodyMedium(
|
||||
text: 'User Code',
|
||||
),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: ColorsManager.greyColor,
|
||||
size: 15,
|
||||
)
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 15),
|
||||
height: 1,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BodyMedium(
|
||||
text: 'Delete Account',
|
||||
),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: ColorsManager.greyColor,
|
||||
size: 15,
|
||||
)
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 15),
|
||||
height: 1,
|
||||
color: ColorsManager.greyColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BodyMedium(
|
||||
text: 'Device Update',
|
||||
),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: ColorsManager.greyColor,
|
||||
size: 15,
|
||||
)
|
||||
// Container(
|
||||
// margin: const EdgeInsets.symmetric(vertical: 15),
|
||||
// height: 1,
|
||||
// color: ColorsManager.greyColor,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
// InkWell(
|
||||
// onTap: () {},
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// children: [
|
||||
// const Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// BodyMedium(
|
||||
// text: 'App Lock',
|
||||
// ),
|
||||
// Icon(
|
||||
// Icons.arrow_forward_ios,
|
||||
// color: ColorsManager.greyColor,
|
||||
// size: 15,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// Container(
|
||||
// margin: const EdgeInsets.symmetric(vertical: 15),
|
||||
// height: 1,
|
||||
// color: ColorsManager.greyColor,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// InkWell(
|
||||
// onTap: () {},
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// children: [
|
||||
// const Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// BodyMedium(
|
||||
// text: 'User Code',
|
||||
// ),
|
||||
// Icon(
|
||||
// Icons.arrow_forward_ios,
|
||||
// color: ColorsManager.greyColor,
|
||||
// size: 15,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// Container(
|
||||
// margin: const EdgeInsets.symmetric(vertical: 15),
|
||||
// height: 1,
|
||||
// color: ColorsManager.greyColor,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// InkWell(
|
||||
// onTap: () {},
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// children: [
|
||||
// const Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// BodyMedium(
|
||||
// text: 'Delete Account',
|
||||
// ),
|
||||
// Icon(
|
||||
// Icons.arrow_forward_ios,
|
||||
// color: ColorsManager.greyColor,
|
||||
// size: 15,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// Container(
|
||||
// margin: const EdgeInsets.symmetric(vertical: 15),
|
||||
// height: 1,
|
||||
// color: ColorsManager.greyColor,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// InkWell(
|
||||
// onTap: () {},
|
||||
// child: const Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// BodyMedium(
|
||||
// text: 'Device Update',
|
||||
// ),
|
||||
// Icon(
|
||||
// Icons.arrow_forward_ios,
|
||||
// color: ColorsManager.greyColor,
|
||||
// size: 15,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user