2021-04-23 12:05:06 +00:00
|
|
|
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,
|
2021-04-26 08:49:33 +00:00
|
|
|
@required bool visible,
|
2021-04-23 12:05:06 +00:00
|
|
|
}) : 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(),
|
2021-04-26 08:49:33 +00:00
|
|
|
visible: visible,
|
2021-04-23 12:05:06 +00:00
|
|
|
);
|
|
|
|
}
|