mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-13 05:16:43 +02:00
Minor bug: avoid showing empty dialog when notifications tapped (#2250)
This commit is contained in:
@ -197,26 +197,28 @@ class NotificationsProvider {
|
||||
}
|
||||
|
||||
_showNotificationPayload(String? payload, {bool doublePop = false}) {
|
||||
var title = (payload ?? '\n\n').split('\n').first;
|
||||
var content = (payload ?? '\n\n').split('\n').sublist(1).join('\n');
|
||||
globalNavigatorKey.currentState?.push(
|
||||
PageRouteBuilder(
|
||||
pageBuilder: (context, _, __) => AlertDialog(
|
||||
title: Text(title),
|
||||
content: Text(content),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(null);
|
||||
if (doublePop) {
|
||||
if (payload?.isNotEmpty == true) {
|
||||
var title = (payload ?? '\n\n').split('\n').first;
|
||||
var content = (payload ?? '\n\n').split('\n').sublist(1).join('\n');
|
||||
globalNavigatorKey.currentState?.push(
|
||||
PageRouteBuilder(
|
||||
pageBuilder: (context, _, __) => AlertDialog(
|
||||
title: Text(title),
|
||||
content: Text(content),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(null);
|
||||
}
|
||||
},
|
||||
child: Text(tr('ok'))),
|
||||
],
|
||||
if (doublePop) {
|
||||
Navigator.of(context).pop(null);
|
||||
}
|
||||
},
|
||||
child: Text(tr('ok'))),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> cancel(int id) async {
|
||||
|
Reference in New Issue
Block a user