Skip to content

Commit

Permalink
notification page updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Hareesh-Nandigrama committed Jul 31, 2023
1 parent acb8399 commit 8dc81f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 98 deletions.
101 changes: 3 additions & 98 deletions lib/pages/notifications/notification_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,107 +27,12 @@ class _NotificationSettingsState extends State<NotificationSettings> {
),
body: Column(
children: [
NotifToggle(text: 'announcement'),
NotifToggle(text: 'cab sharing'),
NotifToggle(text: 'lost'),
NotifToggle(text: 'found'),
NotifToggle(text: 'announcement'),
// Padding(
// padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 16),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text('Cab Sharing', style: MyFonts.w500.setColor(kWhite),),
// FlutterSwitch(
// toggleSize: 20,
// toggleColor: kWhite,
// inactiveColor: kGrey,
// activeColor: lBlue2,
// height: 32,
// width: 52,
// value: cab,
// onToggle: (val) {
// print("Cab Sharing toggle is changed to $cab");
// setState(() {
// cab = val;
// LoginStore.updateNotifPref("cab sharing");
// });
// },
// ),
// ],
// ),
// ),
// Padding(
// padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 16),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text('Lost', style: MyFonts.w500.setColor(kWhite),),
// FlutterSwitch(
// toggleSize: 20,
// toggleColor: kWhite,
// inactiveColor: kGrey,
// activeColor: lBlue2,
// height: 32,
// width: 52,
// value: lost,
// onToggle: (val) {
// print("Lost toggle is changed to $lost");
// setState(() {
// lost = val;
// });
// },
// ),
// ],
// ),
// ),
// Padding(
// padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 16),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text('Found', style: MyFonts.w500.setColor(kWhite),),
// FlutterSwitch(
// toggleSize: 20,
// toggleColor: kWhite,
// inactiveColor: kGrey,
// activeColor: lBlue2,
// height: 32,
// width: 52,
// value: found,
// onToggle: (val) {
// print("Found toggle is changed to $found");
// setState(() {
// found = val;
// });
// },
// ),
// ],
// ),
// ),
// Padding(
// padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 16),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text('General Announcement', style: MyFonts.w500.setColor(kWhite),),
// FlutterSwitch(
// toggleSize: 20,
// toggleColor: kWhite,
// inactiveColor: kGrey,
// activeColor: lBlue2,
// height: 32,
// width: 52,
// value: announcement,
// onToggle: (val) {
// print("Announcement toggle is changed to $announcement");
// setState(() {
// announcement = val;
// });
// },
// ),
// ],
// ),
// )
NotifToggle(text: 'buy'),
NotifToggle(text: 'sell'),
],
),
);
Expand Down
4 changes: 4 additions & 0 deletions lib/services/notifications_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Future<bool> checkForNotifications() async {
);
print("Message is ${message.data}");
if (checkNotificationCategory(message.data['category'])) {
print("apple");
final SharedPreferences preferences = await SharedPreferences.getInstance();
var notifInfo = jsonDecode(preferences.getString("notifInfo")!);
if(notifInfo[message.data['category']])
Expand All @@ -151,6 +152,9 @@ Future<bool> checkForNotifications() async {
}

}
else{
print("ball");
}
saveNotification(message);
});

Expand Down

0 comments on commit 8dc81f0

Please sign in to comment.