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({
|
2022-03-10 18:39:57 +00:00
|
|
|
Key? key,
|
|
|
|
required
|
2021-04-23 12:05:06 +00:00
|
|
|
GlobalKey<PushNotificationsConfigurationWidgetState>
|
|
|
|
pushNotificationsKey,
|
2022-03-10 18:39:57 +00:00
|
|
|
required Function() onConfigured,
|
|
|
|
required Function() onChanged,
|
|
|
|
required bool visible,
|
2022-03-11 15:36:42 +00:00
|
|
|
}) : super(
|
2021-04-23 12:05:06 +00:00
|
|
|
icon: Icons.notifications,
|
2022-03-10 18:39:57 +00:00
|
|
|
title: tr("Push notifications")!,
|
2021-04-23 12:05:06 +00:00
|
|
|
child: (c) => PushNotificationsConfigurationWidget(
|
|
|
|
key: pushNotificationsKey,
|
|
|
|
onConfigured: onConfigured,
|
|
|
|
onChanged: onChanged,
|
|
|
|
),
|
2022-03-11 15:21:35 +00:00
|
|
|
canGoNext: pushNotificationsKey.currentState?.canSubmit ?? false,
|
2022-03-10 18:39:57 +00:00
|
|
|
onTapNext: (c) => pushNotificationsKey.currentState!.submit(),
|
2021-04-26 08:49:33 +00:00
|
|
|
visible: visible,
|
2021-04-23 12:05:06 +00:00
|
|
|
);
|
|
|
|
}
|