mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Add new panes to tour
This commit is contained in:
		@@ -1,7 +1,12 @@
 | 
				
			|||||||
 | 
					import 'package:comunic/forez/helpers/forez_group_helper.dart';
 | 
				
			||||||
import 'package:comunic/forez/tour/join_group_pane.dart';
 | 
					import 'package:comunic/forez/tour/join_group_pane.dart';
 | 
				
			||||||
 | 
					import 'package:comunic/ui/routes/forez_presence_settings_route.dart';
 | 
				
			||||||
import 'package:comunic/ui/routes/tour_route.dart';
 | 
					import 'package:comunic/ui/routes/tour_route.dart';
 | 
				
			||||||
 | 
					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/tour_notifications_pane.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';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -21,13 +26,38 @@ List<Widget> buildTour(TourRouteState state) {
 | 
				
			|||||||
    FirstTourPane(
 | 
					    FirstTourPane(
 | 
				
			||||||
      msgOne: tr(
 | 
					      msgOne: tr(
 | 
				
			||||||
          "Welcome to #Forez, the central application dedicated to events planning in the Forez plain!"),
 | 
					          "Welcome to #Forez, the central application dedicated to events planning in the Forez plain!"),
 | 
				
			||||||
      msgTwo: tr(
 | 
					      msgTwo: tr("Let's first join a Forez group!"),
 | 
				
			||||||
          "Let's configure the application and present you some essential features!"),
 | 
					 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
    JoinGroupPane(
 | 
					    JoinForezGroupPane(
 | 
				
			||||||
      key: state.pubKeys[_JOIN_GROUP_KEY_ID],
 | 
					      key: state.pubKeys[_JOIN_GROUP_KEY_ID],
 | 
				
			||||||
      onUpdated: () => state.rebuild(),
 | 
					      onUpdated: () => state.rebuild(),
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
 | 
					    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,
 | 
				
			||||||
 | 
					      title: tr("Forez in presence"),
 | 
				
			||||||
 | 
					      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()),
 | 
				
			||||||
 | 
					    ),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    LastTourPane(),
 | 
					    LastTourPane(),
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,8 +14,8 @@ import 'package:flutter/material.dart';
 | 
				
			|||||||
///
 | 
					///
 | 
				
			||||||
/// @author Pierre Hubert
 | 
					/// @author Pierre Hubert
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class JoinGroupPane extends PresentationPane {
 | 
					class JoinForezGroupPane extends PresentationPane {
 | 
				
			||||||
  JoinGroupPane({
 | 
					  JoinForezGroupPane({
 | 
				
			||||||
    @required Function() onUpdated,
 | 
					    @required Function() onUpdated,
 | 
				
			||||||
    @required GlobalKey<JoinGroupPaneBodyState> key,
 | 
					    @required GlobalKey<JoinGroupPaneBodyState> key,
 | 
				
			||||||
  }) : super(
 | 
					  }) : super(
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -114,7 +114,10 @@ class PushNotificationsConfigurationWidgetState
 | 
				
			|||||||
        child: Column(
 | 
					        child: Column(
 | 
				
			||||||
          children: [
 | 
					          children: [
 | 
				
			||||||
            Text(
 | 
					            Text(
 | 
				
			||||||
              tr("Comunic can send you push notifications to your device."),
 | 
					              tr("%app% can send you push notifications to your device.",
 | 
				
			||||||
 | 
					                  args: {
 | 
				
			||||||
 | 
					                    "app": config().appName,
 | 
				
			||||||
 | 
					                  }),
 | 
				
			||||||
              textAlign: TextAlign.center,
 | 
					              textAlign: TextAlign.center,
 | 
				
			||||||
            ),
 | 
					            ),
 | 
				
			||||||
            SizedBox(height: 10),
 | 
					            SizedBox(height: 10),
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -78,18 +78,18 @@ class _InitializeWidgetState extends SafeState<InitializeWidget> {
 | 
				
			|||||||
        return;
 | 
					        return;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      final prefs = await PreferencesHelper.getInstance();
 | 
					 | 
				
			||||||
      if (!prefs.getBool(PreferencesKeyList.IS_TOUR_SEEN))
 | 
					 | 
				
			||||||
        await showTour(context);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      print("Attempting WebSocket connection...");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      setState(() {
 | 
					      setState(() {
 | 
				
			||||||
        _error = false;
 | 
					        _error = false;
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      await WebSocketHelper.connect();
 | 
					      await WebSocketHelper.connect();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      final prefs = await PreferencesHelper.getInstance();
 | 
				
			||||||
 | 
					      if (!prefs.getBool(PreferencesKeyList.IS_TOUR_SEEN))
 | 
				
			||||||
 | 
					        await showTour(context);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      print("Attempting WebSocket connection...");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      setState(() {});
 | 
					      setState(() {});
 | 
				
			||||||
    } catch (e, stack) {
 | 
					    } catch (e, stack) {
 | 
				
			||||||
      print("Could not connect to server! $e");
 | 
					      print("Could not connect to server! $e");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user