Skip to content

Commit

Permalink
Merge pull request #2547 from airqo-platform/work-on-settings
Browse files Browse the repository at this point in the history
Work on settings
  • Loading branch information
Mozart299 authored Mar 5, 2025
2 parents df17b8d + c182fde commit 5a7daf1
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 99 deletions.
14 changes: 7 additions & 7 deletions src/mobile-v3/lib/src/app/profile/pages/profile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ class _ProfilePageState extends State<ProfilePage> {
),
)),
),
SizedBox(width: 8),
CircleAvatar(
backgroundColor: Theme.of(context)
.highlightColor,
radius: 26,
child: SvgPicture.asset(
"assets/icons/notification.svg"))
//SizedBox(width: 8),
// CircleAvatar(
// backgroundColor: Theme.of(context)
// .highlightColor,
// radius: 26,
// child: SvgPicture.asset(
// "assets/icons/notification.svg"))
],
)
],
Expand Down
184 changes: 92 additions & 92 deletions src/mobile-v3/lib/src/app/profile/pages/widgets/settings_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,49 +92,49 @@ class _SettingsWidgetState extends State<SettingsWidget> {
}


void _showDeleteAccountDialog() {
final TextEditingController passwordController = TextEditingController();
// void _showDeleteAccountDialog() {
// final TextEditingController passwordController = TextEditingController();

showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text('Delete Account'),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
'WARNING: This action cannot be undone. All your data will be permanently deleted.',
style: TextStyle(color: Colors.red),
),
const SizedBox(height: 16),
TextField(
controller: passwordController,
obscureText: true,
decoration: const InputDecoration(
labelText: 'Enter Password to Confirm',
border: OutlineInputBorder(),
),
),
],
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: const Text('Cancel'),
),
ElevatedButton(
onPressed: () {
// TODO: Implement actual account deletion logic
// Validate password, call backend deletion endpoint
Navigator.of(context).pushReplacementNamed('/login');
},
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
child: const Text('Delete Account'),
),
],
),
);
}
// showDialog(
// context: context,
// builder: (context) => AlertDialog(
// title: const Text('Delete Account'),
// content: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// const Text(
// 'WARNING: This action cannot be undone. All your data will be permanently deleted.',
// style: TextStyle(color: Colors.red),
// ),
// const SizedBox(height: 16),
// TextField(
// controller: passwordController,
// obscureText: true,
// decoration: const InputDecoration(
// labelText: 'Enter Password to Confirm',
// border: OutlineInputBorder(),
// ),
// ),
// ],
// ),
// actions: [
// TextButton(
// onPressed: () => Navigator.pop(context),
// child: const Text('Cancel'),
// ),
// ElevatedButton(
// onPressed: () {
// // TODO: Implement actual account deletion logic
// // Validate password, call backend deletion endpoint
// Navigator.of(context).pushReplacementNamed('/login');
// },
// style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
// child: const Text('Delete Account'),
// ),
// ],
// ),
// );
// }

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -165,53 +165,53 @@ class _SettingsWidgetState extends State<SettingsWidget> {
),

// Notifications Setting
SettingsTile(
switchValue: _notificationsEnabled,
iconPath: "assets/icons/notification.svg",
title: "Notifications",
onChanged: (value) {
setState(() {
_notificationsEnabled = value;
});
print("Notifications setting: $value");
},
description:
"AirQo to send you in-app & push notifications & spike alerts.",
),
// SettingsTile(
// switchValue: _notificationsEnabled,
// iconPath: "assets/icons/notification.svg",
// title: "Notifications",
// onChanged: (value) {
// setState(() {
// _notificationsEnabled = value;
// });
// print("Notifications setting: $value");
// },
// description:
// "AirQo to send you in-app & push notifications & spike alerts.",
// ),

// Send Feedback
SettingsTile(
iconPath: "assets/images/shared/feedback_icon.svg",
title: "Send Feedback",
onChanged: (value) {
print("Send Feedback tapped");
},
),
// SettingsTile(
// iconPath: "assets/images/shared/feedback_icon.svg",
// title: "Send Feedback",
// onChanged: (value) {
// print("Send Feedback tapped");
// },
// ),

// Our Story
SettingsTile(
iconPath: "assets/images/shared/airqo_story_icon.svg",
title: "Our Story",
onChanged: (value) {
print("Our Story tapped");
},
),
// SettingsTile(
// iconPath: "assets/images/shared/airqo_story_icon.svg",
// title: "Our Story",
// onChanged: (value) {
// print("Our Story tapped");
// },
// ),

// Terms and Privacy Policy
SettingsTile(
iconPath: "assets/images/shared/terms_and_privacy.svg",
title: "Terms and Privacy Policy",
onChanged: (value) {
print("Terms and Privacy Policy tapped");
},
),
// SettingsTile(
// iconPath: "assets/images/shared/terms_and_privacy.svg",
// title: "Terms and Privacy Policy",
// onChanged: (value) {
// print("Terms and Privacy Policy tapped");
// },
// ),

// Logout Button
Padding(
padding: EdgeInsets.symmetric(vertical: screenHeight * 0.05),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
backgroundColor: Colors.red,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
Expand All @@ -229,22 +229,22 @@ class _SettingsWidgetState extends State<SettingsWidget> {
),

// Delete Account Section
Padding(
padding: EdgeInsets.symmetric(horizontal: screenWidth * 0.3),
child: InkWell(
onTap: _showDeleteAccountDialog,
child: Text(
"Delete Account",
style: TextStyle(
color: Colors.red.shade300,
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline,
),
),
),
),
// Padding(
// padding: EdgeInsets.symmetric(horizontal: screenWidth * 0.3),
// child: InkWell(
// onTap: _showDeleteAccountDialog,
// child: Text(
// "Delete Account",
// style: TextStyle(
// color: Colors.red.shade300,
// fontWeight: FontWeight.bold,
// decoration: TextDecoration.underline,
// ),
// ),
// ),
// ),

SizedBox(height: screenHeight * 0.03),
SizedBox(height: screenHeight * 0.01),

// App Info
Center(
Expand Down

0 comments on commit 5a7daf1

Please sign in to comment.