mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-21 20:39:22 +00:00
Update notifications pane
This commit is contained in:
parent
522ef8e471
commit
306271cfb5
@ -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(
|
||||
|
32
lib/ui/widgets/tour/tour_notifications_pane.dart
Normal file
32
lib/ui/widgets/tour/tour_notifications_pane.dart
Normal 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(),
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user