1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-26 12:58:51 +00:00

Update notifications pane

This commit is contained in:
Pierre HUBERT 2021-04-23 14:05:06 +02:00
parent 522ef8e471
commit 306271cfb5
2 changed files with 37 additions and 10 deletions

View File

@ -8,6 +8,7 @@ import 'package:comunic/ui/widgets/tour/account_image_tour_pane.dart';
import 'package:comunic/ui/widgets/tour/first_pane.dart';
import 'package:comunic/ui/widgets/tour/last_pane.dart';
import 'package:comunic/ui/widgets/tour/presentation_pane.dart';
import 'package:comunic/ui/widgets/tour/tour_notifications_pane.dart';
import 'package:comunic/utils/account_utils.dart';
import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart';
@ -55,16 +56,10 @@ class _TourRouteState extends State<TourRoute> {
),
// Notifications
PresentationPane(
icon: Icons.notifications,
title: tr("Push notifications"),
child: (c) => PushNotificationsConfigurationWidget(
key: _pushNotificationsKey,
onConfigured: () => setState(() {}),
onChanged: () => setState(() {}),
),
canGoNext: _pushNotificationsKey?.currentState?.canSubmit ?? false,
onTapNext: (c) => _pushNotificationsKey.currentState.submit(),
TourNotificationsPane(
pushNotificationsKey: _pushNotificationsKey,
onConfigured: () => setState(() {}),
onChanged: () => setState(() {}),
),
PresentationPane(

View File

@ -0,0 +1,32 @@
import 'package:comunic/ui/routes/push_notifications_route.dart';
import 'package:comunic/ui/widgets/tour/presentation_pane.dart';
import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart';
/// Tour notifications pane
///
/// Invite the user to configure push notifications for its device
///
/// @author Pierre Hubert
class TourNotificationsPane extends PresentationPane {
TourNotificationsPane({
Key key,
@required
GlobalKey<PushNotificationsConfigurationWidgetState>
pushNotificationsKey,
@required Function() onConfigured,
@required Function() onChanged,
}) : assert(pushNotificationsKey != null),
super(
icon: Icons.notifications,
title: tr("Push notifications"),
child: (c) => PushNotificationsConfigurationWidget(
key: pushNotificationsKey,
onConfigured: onConfigured,
onChanged: onChanged,
),
canGoNext: pushNotificationsKey?.currentState?.canSubmit ?? false,
onTapNext: (c) => pushNotificationsKey.currentState.submit(),
);
}