1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-26 23:09:21 +00:00
comunicmobile/lib/forez/tour/forez_tour_builder.dart

72 lines
2.5 KiB
Dart
Raw Normal View History

2021-04-24 06:51:56 +00:00
import 'package:comunic/forez/helpers/forez_group_helper.dart';
2021-04-23 16:46:35 +00:00
import 'package:comunic/forez/tour/join_group_pane.dart';
2021-04-24 06:51:56 +00:00
import 'package:comunic/ui/routes/forez_presence_settings_route.dart';
2021-04-23 16:46:35 +00:00
import 'package:comunic/ui/routes/tour_route.dart';
2021-04-24 06:51:56 +00:00
import 'package:comunic/ui/widgets/tour/account_image_tour_pane.dart';
2021-04-23 16:46:35 +00:00
import 'package:comunic/ui/widgets/tour/first_pane.dart';
import 'package:comunic/ui/widgets/tour/last_pane.dart';
2021-04-24 06:51:56 +00:00
import 'package:comunic/ui/widgets/tour/presentation_pane.dart';
import 'package:comunic/ui/widgets/tour/tour_notifications_pane.dart';
2021-04-23 16:46:35 +00:00
import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart';
/// Forez tour builder
///
/// Handles the presentation tour for the Forez flavor application
///
/// @author Pierre Hubert
const _JOIN_GROUP_KEY_ID = 1;
List<Widget> buildTour(TourRouteState state) {
if (!state.pubKeys.containsKey(_JOIN_GROUP_KEY_ID))
2021-04-23 17:32:34 +00:00
state.pubKeys[_JOIN_GROUP_KEY_ID] = GlobalKey<JoinGroupPaneBodyState>();
2021-04-23 16:46:35 +00:00
return [
FirstTourPane(
msgOne: tr(
"Welcome to #Forez, the central application dedicated to events planning in the Forez plain!"),
2021-04-24 06:51:56 +00:00
msgTwo: tr("Let's first join a Forez group!"),
2021-04-23 16:46:35 +00:00
),
2021-04-24 06:51:56 +00:00
JoinForezGroupPane(
2021-04-23 16:46:35 +00:00
key: state.pubKeys[_JOIN_GROUP_KEY_ID],
onUpdated: () => state.rebuild(),
),
2021-04-24 06:51:56 +00:00
FirstTourPane(
msgOne: tr("Great, you are now a member of a Forez group!"),
msgTwo: tr(
"Before we continue, you must be aware that #Forez is now based on Comunic, so you are using Comunic in fact..."),
),
AccountImageTourPane(
user: state.currUser,
onUpdated: (ctx) => state.setStateKeepCurrentIndex(ctx),
),
TourNotificationsPane(
pushNotificationsKey: state.pushNotificationsKey,
onConfigured: state.rebuild,
onChanged: state.rebuild,
),
// Forez specific features
PresentationPane(
icon: Icons.calendar_today,
2021-04-25 16:03:04 +00:00
title: tr("Presence in Forez"),
2021-04-24 06:51:56 +00:00
text: tr(
"Easily specify the days you are in Forez plain, so that everyone can know it!"),
actionTitle: tr("Do it now!"),
onActionTap: (context) async =>
showPresenceSettingsRoute(context, await ForezGroupHelper.getId()),
),
2021-04-24 06:59:56 +00:00
// Chat pane
PresentationPane(
icon: Icons.question_answer,
title: tr("Conversations"),
text: tr(
"#Forez now integrates the conversation system of Comunic, so you have access both to public and private conversations!"),
),
2021-04-23 16:46:35 +00:00
LastTourPane(),
];
}