Skip to content

Commit

Permalink
Custom notifications can't be restarted
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed May 30, 2021
1 parent 16a2999 commit e3f2762
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
14 changes: 12 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ class MyApp extends StatelessWidget {
create: (ctx) {
final dataService = getIt<DataService>();
final notificationService = getIt<NotificationService>();
return NotificationsBloc(dataService, notificationService);
final settingsService = getIt<SettingsService>();
return NotificationsBloc(dataService, notificationService, settingsService);
},
),
BlocProvider(
Expand All @@ -238,7 +239,16 @@ class MyApp extends StatelessWidget {
final localeService = getIt<LocaleService>();
final loggingService = getIt<LoggingService>();
final telemetryService = getIt<TelemetryService>();
return NotificationBloc(dataService, notificationService, genshinService, localeService, loggingService, telemetryService);
final settingsService = getIt<SettingsService>();
return NotificationBloc(
dataService,
notificationService,
genshinService,
localeService,
loggingService,
telemetryService,
settingsService,
);
},
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ class NotificationListTitle extends StatelessWidget {
foregroundColor: Colors.white,
onTap: () => _showEditModal(context),
),
IconSlideAction(
caption: s.reset,
color: Colors.green,
icon: Icons.restore,
foregroundColor: Colors.white,
onTap: () => context.read<NotificationsBloc>().add(NotificationsEvent.reset(id: itemKey, type: type)),
),
if (type != AppNotificationType.custom)
IconSlideAction(
caption: s.reset,
color: Colors.green,
icon: Icons.restore,
foregroundColor: Colors.white,
onTap: () => context.read<NotificationsBloc>().add(NotificationsEvent.reset(id: itemKey, type: type)),
),
],
child: ListTile(
contentPadding: Styles.edgeInsetAll5,
Expand Down

0 comments on commit e3f2762

Please sign in to comment.