1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 12:59:21 +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/first_pane.dart';
import 'package:comunic/ui/widgets/tour/last_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/presentation_pane.dart';
import 'package:comunic/ui/widgets/tour/tour_notifications_pane.dart';
import 'package:comunic/utils/account_utils.dart'; import 'package:comunic/utils/account_utils.dart';
import 'package:comunic/utils/intl_utils.dart'; import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -55,17 +56,11 @@ class _TourRouteState extends State<TourRoute> {
), ),
// Notifications // Notifications
PresentationPane( TourNotificationsPane(
icon: Icons.notifications, pushNotificationsKey: _pushNotificationsKey,
title: tr("Push notifications"),
child: (c) => PushNotificationsConfigurationWidget(
key: _pushNotificationsKey,
onConfigured: () => setState(() {}), onConfigured: () => setState(() {}),
onChanged: () => setState(() {}), onChanged: () => setState(() {}),
), ),
canGoNext: _pushNotificationsKey?.currentState?.canSubmit ?? false,
onTapNext: (c) => _pushNotificationsKey.currentState.submit(),
),
PresentationPane( PresentationPane(
icon: Icons.group_add, icon: Icons.group_add,

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(),
);
}