diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 786a92380..a4a85d250 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -10,7 +10,6 @@ jobs: steps: - uses: actions/checkout@v2 - run: cat .github/workflows/versions.env >> $GITHUB_ENV - - run: echo "$WEB_APP_ENV" > .env - uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} @@ -31,7 +30,6 @@ jobs: steps: - uses: actions/checkout@v2 - run: cat .github/workflows/versions.env >> $GITHUB_ENV - - run: echo "$WEB_APP_ENV" > .env - uses: actions/setup-java@v1 with: java-version: ${{ env.JAVA_VERSION }} @@ -47,7 +45,6 @@ jobs: steps: - uses: actions/checkout@v2 - run: cat .github/workflows/versions.env >> $GITHUB_ENV - - run: echo "$WEB_APP_ENV" > .env - uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} @@ -62,7 +59,6 @@ jobs: steps: - uses: actions/checkout@v2 - run: cat .github/workflows/versions.env >> $GITHUB_ENV - - run: echo "$WEB_APP_ENV" > .env - uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} @@ -77,7 +73,6 @@ jobs: steps: - uses: actions/checkout@v2 - run: cat .github/workflows/versions.env >> $GITHUB_ENV - - run: echo "$WEB_APP_ENV" > .env - uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} diff --git a/.github/workflows/main_deploy.yaml b/.github/workflows/main_deploy.yaml index b21a1dab4..d3567e06e 100644 --- a/.github/workflows/main_deploy.yaml +++ b/.github/workflows/main_deploy.yaml @@ -4,15 +4,18 @@ on: push: branches: - main - - pangea-merge +env: + # Setting an environment variable with the value of a configuration variable + WEB_APP_ENV: ${{ vars.WEB_APP_ENV }} + jobs: deploy_web: runs-on: ubuntu-latest + environment: staging steps: - uses: actions/checkout@v2 - run: cat .github/workflows/versions.env >> $GITHUB_ENV - - run: echo "$WEB_APP_ENV" > .env - uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} @@ -23,18 +26,20 @@ jobs: - name: Prepare web run: ./scripts/prepare-web.sh - name: Build Release Web - run: flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --release --source-maps --base-href "/client/" + run: ./scripts/build-web.sh - name: Build Website run: | mv build/web public - mv .env public/.env + touch public/.env + echo "$WEB_APP_ENV" >> public/.env + cp public/.env public/assets/.env - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }} publish_dir: ./public publish_branch: gh-pages - # cname: app.staging.pangea.chat.im + # cname: app.staging.pangea.chat update_sentry: runs-on: ubuntu-latest diff --git a/.github/workflows/old.yml b/.github/workflows/old.yml index 21250a3ea..a701797de 100644 --- a/.github/workflows/old.yml +++ b/.github/workflows/old.yml @@ -3,8 +3,7 @@ name: Old Release Workflow on: push: branches: - - main - - pangea-merge + - master-unused concurrency: group: release_workflow diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3c87c2c94..e26c8f2fa 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -27,20 +27,20 @@ jobs: - name: Build Release Web run: flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --release --source-maps - name: Create archive - run: tar -czf fluffychat-web.tar.gz build/web/ + run: tar -czf pangeachat-web.tar.gz build/web/ - name: Upload Web Build uses: actions/upload-artifact@v2 with: name: Web Build - path: fluffychat-web.tar.gz + path: pangeachat-web.tar.gz - name: Upload to release uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: fluffychat-web.tar.gz - asset_name: fluffychat-web.tar.gz + asset_path: pangeachat-web.tar.gz + asset_name: pangeachat-web.tar.gz asset_content_type: application/gzip build_apk: diff --git a/.gitignore b/.gitignore index 6f1d4f585..ef7038f03 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ .svn/ prime *.env +!/public/.env # libolm package /assets/js/package diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 5dc8cd899..0316172e9 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -3339,7 +3339,12 @@ "downloadTxtFile": "Download Text File", "downloadCSVFile": "Download CSV File", "promotionalSubscriptionDesc": "You currently have a lifetime promotional subscription. Message support@pangea.chat for help changing your subscription.", - "originalSubscriptionPlatform": "Subscription purchased through", + "originalSubscriptionPlatform": "Subscription purchased through {purchasePlatform}", + "@originalSubscriptionPlatform": { + "placeholders": { + "purchasePlatform": {} + } + }, "oneWeekTrial": "One Week Trial", "creatingSpacePleaseWait": "Creating space. Please wait...", "downloadXLSXFile": "Download Excel File", @@ -3938,5 +3943,15 @@ "groupName": "Group name", "createGroupAndInviteUsers": "Create a group and invite users", "groupCanBeFoundViaSearch": "Group can be found via search", - "inNoSpaces": "You are not a member of any classes or exchanges" + "trialExpiration": "Your free trial expires on {expiration}", + "@trialExpiration": { + "placeholders": { + "expiration": {} + } + }, + "freeTrialDesc": "New users recieve a one week free trial of Pangea Chat", + "activateTrial": "Activate Trial", + "inNoSpaces": "You are not a member of any classes or exchanges", + "successfullySubscribed": "You have successfully subscribed!", + "clickToManageSubscription": "Click here to manage your subscription." } diff --git a/config.sample.json b/config.sample.json index ff37ec238..03ac42a6a 100644 --- a/config.sample.json +++ b/config.sample.json @@ -1,9 +1,9 @@ { - "application_name": "FluffyChat", + "application_name": "PangeaChat", "application_welcome_message": null, - "default_homeserver": "matrix.org", - "web_base_url": "https://fluffychat.im/web", - "privacy_url": "https://fluffychat.im/en/privacy.html", + "default_homeserver": "matrix.pangea.chat", + "web_base_url": "https://web.pangea.chat", + "privacy_url": "https://pangea.chat/privacy", "render_html": false, "hide_redacted_events": false, "hide_unknown_events": false diff --git a/lib/config/app_config.dart b/lib/config/app_config.dart index b3c85c116..97cde1e2a 100644 --- a/lib/config/app_config.dart +++ b/lib/config/app_config.dart @@ -1,8 +1,8 @@ import 'dart:ui'; -import 'package:matrix/matrix.dart'; - import 'package:fluffychat/pangea/config/environment.dart'; +// Project imports: +import 'package:matrix/matrix.dart'; abstract class AppConfig { // #Pangea @@ -121,6 +121,7 @@ abstract class AppConfig { "https://buy.stripe.com/test_bIY6ssd8z5Uz8ec8ww"; static String iosPromoCode = "https://apps.apple.com/redeem?ctx=offercodes&id=1445118630&code="; + static String trialSubscriptionId = "pangea_new_user_trial"; // Pangea# static void loadFromJson(Map json) { diff --git a/lib/pages/chat_details/chat_details_view.dart b/lib/pages/chat_details/chat_details_view.dart index bfd22fbcf..ecebb9dd8 100644 --- a/lib/pages/chat_details/chat_details_view.dart +++ b/lib/pages/chat_details/chat_details_view.dart @@ -1,10 +1,3 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_gen/gen_l10n/l10n.dart'; -import 'package:future_loading_dialog/future_loading_dialog.dart'; -import 'package:go_router/go_router.dart'; -import 'package:matrix/matrix.dart'; - import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/pages/chat_details/chat_details.dart'; import 'package:fluffychat/pages/chat_details/participant_list_item.dart'; @@ -26,6 +19,11 @@ import 'package:fluffychat/widgets/avatar.dart'; import 'package:fluffychat/widgets/chat_settings_popup_menu.dart'; import 'package:fluffychat/widgets/layouts/max_width_body.dart'; import 'package:fluffychat/widgets/matrix.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:future_loading_dialog/future_loading_dialog.dart'; +import 'package:go_router/go_router.dart'; +import 'package:matrix/matrix.dart'; class ChatDetailsView extends StatelessWidget { final ChatDetailsController controller; @@ -546,8 +544,10 @@ class ChatDetailsView extends StatelessWidget { backgroundColor: Theme.of(context).scaffoldBackgroundColor, foregroundColor: iconColor, - child: const Icon( - Icons.lock_outlined, + child: Icon( + room.locked + ? Icons.lock_outlined + : Icons.no_encryption_outlined, ), ), value: room.locked, diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 3567d2624..662de6b01 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -1,19 +1,9 @@ import 'dart:async'; import 'dart:io'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - import 'package:adaptive_dialog/adaptive_dialog.dart'; import 'package:collection/collection.dart'; -import 'package:flutter_gen/gen_l10n/l10n.dart'; -import 'package:future_loading_dialog/future_loading_dialog.dart'; -import 'package:go_router/go_router.dart'; -import 'package:matrix/matrix.dart'; -import 'package:receive_sharing_intent/receive_sharing_intent.dart'; -import 'package:uni_links/uni_links.dart'; - +// Project imports: import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/config/themes.dart'; import 'package:fluffychat/pages/chat_list/chat_list_view.dart'; @@ -24,10 +14,23 @@ import 'package:fluffychat/pangea/utils/add_to_space.dart'; import 'package:fluffychat/pangea/utils/chat_list_handle_space_tap.dart'; import 'package:fluffychat/pangea/utils/error_handler.dart'; import 'package:fluffychat/pangea/utils/firebase_analytics.dart'; +import 'package:fluffychat/pangea/widgets/subscription/subscription_snackbar.dart'; import 'package:fluffychat/utils/localized_exception_extension.dart'; import 'package:fluffychat/utils/matrix_sdk_extensions/client_stories_extension.dart'; import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart'; import 'package:fluffychat/utils/platform_infos.dart'; +import 'package:fluffychat/utils/tor_stub.dart' + if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:future_loading_dialog/future_loading_dialog.dart'; +import 'package:go_router/go_router.dart'; +import 'package:matrix/matrix.dart'; +import 'package:receive_sharing_intent/receive_sharing_intent.dart'; +import 'package:uni_links/uni_links.dart'; + import '../../../utils/account_bundles.dart'; import '../../utils/matrix_sdk_extensions/matrix_file_extension.dart'; import '../../utils/url_launcher.dart'; @@ -35,9 +38,6 @@ import '../../utils/voip/callkeep_manager.dart'; import '../../widgets/fluffy_chat_app.dart'; import '../../widgets/matrix.dart'; -import 'package:fluffychat/utils/tor_stub.dart' - if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart'; - enum SelectMode { normal, share, @@ -445,6 +445,7 @@ class ChatListController extends State //#Pangea StreamSubscription? classStream; StreamSubscription? _invitedSpaceSubscription; + StreamSubscription? _subscriptionStatusStream; //Pangea# @override @@ -502,6 +503,14 @@ class ChatListController extends State } } }); + + _subscriptionStatusStream = pangeaController + .subscriptionController.subscriptionStream.stream + .listen((event) { + if (mounted) { + showSubscribedSnackbar(context); + } + }); //Pangea# super.initState(); @@ -515,6 +524,7 @@ class ChatListController extends State //#Pangea classStream?.cancel(); _invitedSpaceSubscription?.cancel(); + _subscriptionStatusStream?.cancel(); //Pangea# scrollController.removeListener(_onScroll); super.dispose(); diff --git a/lib/pages/login/login_view.dart b/lib/pages/login/login_view.dart index 084e05476..259210113 100644 --- a/lib/pages/login/login_view.dart +++ b/lib/pages/login/login_view.dart @@ -1,11 +1,10 @@ // Flutter imports: +import 'package:fluffychat/pangea/utils/password_forgotten.dart'; +import 'package:fluffychat/widgets/layouts/login_scaffold.dart'; import 'package:flutter/material.dart'; - import 'package:flutter_gen/gen_l10n/l10n.dart'; -import 'package:fluffychat/pangea/utils/password_forgotten.dart'; -import 'package:fluffychat/widgets/layouts/login_scaffold.dart'; import 'login.dart'; class LoginView extends StatelessWidget { @@ -20,7 +19,30 @@ class LoginView extends StatelessWidget { // enforceMobileMode: Matrix.of(context).client.isLogged(), // Pangea# appBar: AppBar( - leading: controller.loading ? null : const BackButton(), + // #Pangea + // leading: controller.loading ? null : const BackButton(), + leading: controller.loading + ? null + : Padding( + padding: const EdgeInsets.only(left: 10), + child: ElevatedButton( + onPressed: () => Navigator.of(context).pop(), + style: ButtonStyle( + padding: MaterialStateProperty.all(EdgeInsets.zero), + backgroundColor: MaterialStateProperty.all( + Theme.of(context) + .colorScheme + .background + .withOpacity(0.75), + ), + shape: MaterialStateProperty.all( + const CircleBorder(), + ), + ), + child: const Icon(Icons.arrow_back), + ), + ), + // Pangea# automaticallyImplyLeading: !controller.loading, centerTitle: true, // #Pangea diff --git a/lib/pangea/constants/local.key.dart b/lib/pangea/constants/local.key.dart index 238a3ecc9..b5f118aab 100644 --- a/lib/pangea/constants/local.key.dart +++ b/lib/pangea/constants/local.key.dart @@ -4,4 +4,8 @@ class PLocalKey { static const String classes = 'classes'; static const String cachedClassCodeToJoin = "cachedclasscodetojoin"; + static const String beganWebPayment = "beganWebPayment"; + + // making this a random string so that it's harder to guess + static const String activatedTrialKey = '7C4EuKIsph'; } diff --git a/lib/pangea/controllers/subscription_controller.dart b/lib/pangea/controllers/subscription_controller.dart index 34619e676..f8e932865 100644 --- a/lib/pangea/controllers/subscription_controller.dart +++ b/lib/pangea/controllers/subscription_controller.dart @@ -1,16 +1,9 @@ import 'dart:async'; import 'dart:convert'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; - import 'package:adaptive_dialog/adaptive_dialog.dart'; -import 'package:flutter_gen/gen_l10n/l10n.dart'; -import 'package:http/http.dart'; -import 'package:purchases_flutter/purchases_flutter.dart'; -import 'package:url_launcher/url_launcher_string.dart'; - import 'package:fluffychat/config/app_config.dart'; +import 'package:fluffychat/pangea/constants/local.key.dart'; import 'package:fluffychat/pangea/controllers/base_controller.dart'; import 'package:fluffychat/pangea/controllers/pangea_controller.dart'; import 'package:fluffychat/pangea/models/base_subscription_info.dart'; @@ -22,6 +15,12 @@ import 'package:fluffychat/pangea/utils/error_handler.dart'; import 'package:fluffychat/pangea/utils/firebase_analytics.dart'; import 'package:fluffychat/pangea/widgets/subscription/subscription_paywall.dart'; import 'package:fluffychat/utils/platform_infos.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:http/http.dart'; +import 'package:purchases_flutter/purchases_flutter.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class SubscriptionController extends BaseController { late PangeaController _pangeaController; @@ -29,6 +28,7 @@ class SubscriptionController extends BaseController { //convert this logic to use completer bool initialized = false; + final StreamController subscriptionStream = StreamController.broadcast(); SubscriptionController(PangeaController pangeaController) : super() { _pangeaController = pangeaController; @@ -59,13 +59,32 @@ class SubscriptionController extends BaseController { : MobileSubscriptionInfo(pangeaController: _pangeaController); await subscription!.configure(); + if (activatedNewUserTrial) { + setNewUserTrial(); + } initialized = true; if (!kIsWeb) { Purchases.addCustomerInfoUpdateListener( - (CustomerInfo info) => updateCustomerInfo(), + (CustomerInfo info) async { + final bool wasSubscribed = isSubscribed; + await updateCustomerInfo(); + if (!wasSubscribed && isSubscribed) { + subscriptionStream.add(true); + } + }, ); + } else { + final bool? beganWebPayment = _pangeaController.pStoreService.read( + PLocalKey.beganWebPayment, + ); + if (beganWebPayment ?? false) { + _pangeaController.pStoreService.delete(PLocalKey.beganWebPayment); + if (_pangeaController.subscriptionController.isSubscribed) { + subscriptionStream.add(true); + } + } } setState(); } catch (e, s) { @@ -74,6 +93,26 @@ class SubscriptionController extends BaseController { } } + bool get activatedNewUserTrial => + _pangeaController.userController.inTrialWindow && + (_pangeaController.pStoreService.read(PLocalKey.activatedTrialKey) ?? + false); + + void activateNewUserTrial() { + _pangeaController.pStoreService.save(PLocalKey.activatedTrialKey, true); + setNewUserTrial(); + } + + void setNewUserTrial() { + final String profileCreatedAt = + _pangeaController.userController.userModel!.profile!.createdAt; + final DateTime creationTimestamp = DateTime.parse(profileCreatedAt); + final DateTime expirationDate = creationTimestamp.add( + const Duration(days: 7), + ); + subscription?.setTrial(expirationDate); + } + Future updateCustomerInfo() async { if (subscription == null) { ErrorHandler.logError( @@ -175,6 +214,10 @@ class SubscriptionController extends BaseController { selectedSubscription.duration!, isPromo: isPromo, ); + _pangeaController.pStoreService.save( + PLocalKey.beganWebPayment, + true, + ); setState(); launchUrlString( paymentLink, diff --git a/lib/pangea/controllers/user_controller.dart b/lib/pangea/controllers/user_controller.dart index aeec7a5dc..9cdce7573 100644 --- a/lib/pangea/controllers/user_controller.dart +++ b/lib/pangea/controllers/user_controller.dart @@ -2,14 +2,15 @@ import 'dart:async'; import 'dart:developer'; import 'package:collection/collection.dart'; -import 'package:jwt_decode/jwt_decode.dart'; -import 'package:matrix/matrix.dart' as matrix; - import 'package:fluffychat/pangea/constants/language_keys.dart'; import 'package:fluffychat/pangea/constants/model_keys.dart'; import 'package:fluffychat/pangea/controllers/base_controller.dart'; import 'package:fluffychat/pangea/controllers/pangea_controller.dart'; import 'package:fluffychat/widgets/fluffy_chat_app.dart'; +// Project imports: +import 'package:jwt_decode/jwt_decode.dart'; +import 'package:matrix/matrix.dart' as matrix; + import '../constants/local.key.dart'; import '../models/user_model.dart'; import '../repo/user_repo.dart'; @@ -109,6 +110,16 @@ class UserController extends BaseController { } } + bool get inTrialWindow { + final String? createdAt = userModel?.profile?.createdAt; + if (createdAt == null) { + return false; + } + return DateTime.parse(createdAt).isAfter( + DateTime.now().subtract(const Duration(days: 7)), + ); + } + Future get areUserLanguagesSet async { try { final PUserModel? toCheck = userModel ?? (await fetchUserModel()); diff --git a/lib/pangea/models/base_subscription_info.dart b/lib/pangea/models/base_subscription_info.dart index 604abf6e9..cb04dd57b 100644 --- a/lib/pangea/models/base_subscription_info.dart +++ b/lib/pangea/models/base_subscription_info.dart @@ -1,3 +1,5 @@ +// Project imports: +import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/pangea/controllers/pangea_controller.dart'; import 'package:fluffychat/pangea/controllers/subscription_controller.dart'; import 'package:fluffychat/pangea/repo/subscription_repo.dart'; @@ -44,6 +46,9 @@ class SubscriptionInfo { allProducts = await SubscriptionRepo.getAllProducts(); } + bool get isNewUserTrial => + currentSubscriptionId == AppConfig.trialSubscriptionId; + bool get currentSubscriptionIsPromotional => currentSubscriptionId?.startsWith("rc_promo") ?? false; @@ -70,5 +75,16 @@ class SubscriptionInfo { currentSubscriptionId = null; } + void setTrial(DateTime expiration) { + if (currentSubscription != null) return; + expirationDate = expiration; + currentSubscriptionId = AppConfig.trialSubscriptionId; + currentSubscription = SubscriptionDetails( + price: 0, + id: AppConfig.trialSubscriptionId, + periodType: 'trial', + ); + } + Future setCustomerInfo() async {} } diff --git a/lib/pangea/models/mobile_subscriptions.dart b/lib/pangea/models/mobile_subscriptions.dart index 128724b9e..931488716 100644 --- a/lib/pangea/models/mobile_subscriptions.dart +++ b/lib/pangea/models/mobile_subscriptions.dart @@ -1,15 +1,15 @@ import 'dart:io'; -import 'package:flutter/material.dart'; - +// Package imports: import 'package:collection/collection.dart'; -import 'package:purchases_flutter/purchases_flutter.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; - import 'package:fluffychat/pangea/config/environment.dart'; import 'package:fluffychat/pangea/controllers/subscription_controller.dart'; import 'package:fluffychat/pangea/models/base_subscription_info.dart'; import 'package:fluffychat/pangea/utils/error_handler.dart'; +// Project imports: +import 'package:flutter/material.dart'; +import 'package:purchases_flutter/purchases_flutter.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; class MobileSubscriptionInfo extends SubscriptionInfo { MobileSubscriptionInfo({required super.pangeaController}) : super(); @@ -182,7 +182,9 @@ class MobileSubscriptionInfo extends SubscriptionInfo { ); } else if (activeEntitlements.isEmpty) { debugPrint("User has no active entitlements"); - resetSubscription(); + if (!isNewUserTrial) { + resetSubscription(); + } return; } final EntitlementInfo activeEntitlement = activeEntitlements[0]; diff --git a/lib/pangea/pages/analytics/messages_bar_chart.dart b/lib/pangea/pages/analytics/messages_bar_chart.dart index 21192ec30..5f80577db 100644 --- a/lib/pangea/pages/analytics/messages_bar_chart.dart +++ b/lib/pangea/pages/analytics/messages_bar_chart.dart @@ -1,13 +1,13 @@ import 'dart:developer'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:fluffychat/config/themes.dart'; +import 'package:fluffychat/pangea/pages/analytics/bar_chart_placeholder_data.dart'; +import 'package:fluffychat/pangea/utils/error_handler.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; - -import 'package:fl_chart/fl_chart.dart'; import 'package:intl/intl.dart'; -import 'package:fluffychat/pangea/pages/analytics/bar_chart_placeholder_data.dart'; -import 'package:fluffychat/pangea/utils/error_handler.dart'; import '../../enum/time_span.dart'; import '../../enum/use_type.dart'; import '../../models/chart_analytics_model.dart'; @@ -102,39 +102,73 @@ class MessagesBarChartState extends State { ); } + bool showLabelBasedOnTimeSpan( + TimeSpan timeSpan, + TimeSeriesInterval current, + TimeSeriesInterval? last, + int labelIndex, + ) { + switch (timeSpan) { + case TimeSpan.day: + return current.end.hour % 3 == 0; + case TimeSpan.month: + if (current.end.month != last?.end.month) { + return true; + } + double width = MediaQuery.of(context).size.width; + if (FluffyThemes.isColumnMode(context)) { + width = width - FluffyThemes.navRailWidth - FluffyThemes.columnWidth; + } + const int numDays = 28; + const int minSpacePerDay = 20; + final int availableSpaces = width ~/ minSpacePerDay; + final int showAtInterval = (numDays / availableSpaces).floor() + 1; + + final int lastDayOfCurrentMonth = + DateTime(current.end.year, current.end.month + 1, 0).day; + final bool isNextToMonth = labelIndex == 1 || + current.end.day == 2 || + current.end.day == lastDayOfCurrentMonth; + final bool shouldShowNextToMonth = showAtInterval <= 1; + return (current.end.day % showAtInterval == 0) && + (!isNextToMonth || shouldShowNextToMonth); + case TimeSpan.week: + case TimeSpan.sixmonths: + case TimeSpan.year: + default: + return true; + } + } + String getLabelBasedOnTimeSpan( TimeSpan timeSpan, TimeSeriesInterval current, TimeSeriesInterval? last, int labelIndex, ) { - if (widget.chartAnalytics == null) { + final bool showLabel = showLabelBasedOnTimeSpan( + timeSpan, + current, + last, + labelIndex, + ); + + if (widget.chartAnalytics == null || !showLabel) { return ""; } if (isInSameGroup(last, current, timeSpan)) { return "-"; } + switch (widget.chartAnalytics?.timeSpan ?? TimeSpan.month) { case TimeSpan.day: - return current.end.hour % 3 == 0 - ? DateFormat(DateFormat.HOUR).format(current.end) - : ""; - // return current.end.hour.toString(); + return DateFormat(DateFormat.HOUR).format(current.end); case TimeSpan.week: return DateFormat(DateFormat.ABBR_WEEKDAY).format(current.end); case TimeSpan.month: - // return current.end.month != last?.end.month - // ? DateFormat(DateFormat.ABBR_MONTH_DAY).format(current.end) - // : current.end.day % 5 == 0 && - // labelIndex != 1 && - // current.end.day != 30 - // ? DateFormat(DateFormat.DAY).format(current.end) - // : "'"; return current.end.month != last?.end.month ? DateFormat(DateFormat.ABBR_MONTH).format(current.end) : DateFormat(DateFormat.DAY).format(current.end); - // return current.end.day.toString(); - // text = DateFormat('DAY').format(timeSeriesIntervalStart); case TimeSpan.sixmonths: case TimeSpan.year: return DateFormat(DateFormat.ABBR_STANDALONE_MONTH).format(current.end); diff --git a/lib/pangea/pages/settings_subscription/settings_subscription.dart b/lib/pangea/pages/settings_subscription/settings_subscription.dart index 349e3eade..6b1608cd9 100644 --- a/lib/pangea/pages/settings_subscription/settings_subscription.dart +++ b/lib/pangea/pages/settings_subscription/settings_subscription.dart @@ -1,16 +1,19 @@ import 'dart:async'; -import 'package:flutter/material.dart'; - -import 'package:url_launcher/url_launcher_string.dart'; - +// Project imports: import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/pangea/config/environment.dart'; import 'package:fluffychat/pangea/controllers/pangea_controller.dart'; import 'package:fluffychat/pangea/controllers/subscription_controller.dart'; import 'package:fluffychat/pangea/pages/settings_subscription/settings_subscription_view.dart'; import 'package:fluffychat/pangea/utils/subscription_app_id.dart'; +import 'package:fluffychat/pangea/widgets/subscription/subscription_snackbar.dart'; import 'package:fluffychat/widgets/matrix.dart'; +// Project imports: +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +// Package imports: +import 'package:url_launcher/url_launcher_string.dart'; class SubscriptionManagement extends StatefulWidget { const SubscriptionManagement({super.key}); @@ -24,6 +27,7 @@ class SubscriptionManagementController extends State { final PangeaController pangeaController = MatrixState.pangeaController; SubscriptionDetails? selectedSubscription; late StreamSubscription _settingsSubscription; + StreamSubscription? _subscriptionStatusStream; @override void initState() { @@ -40,6 +44,7 @@ class SubscriptionManagementController extends State { void dispose() { super.dispose(); _settingsSubscription.cancel(); + _subscriptionStatusStream?.cancel(); } bool get currentSubscriptionAvailable => @@ -53,6 +58,10 @@ class SubscriptionManagementController extends State { ?.currentSubscriptionIsPromotional ?? false; + bool get isNewUserTrial => + pangeaController.subscriptionController.subscription?.isNewUserTrial ?? + false; + bool get showManagementOptions { if (!currentSubscriptionAvailable) { return false; @@ -116,6 +125,12 @@ class SubscriptionManagementController extends State { @override Widget build(BuildContext context) { + _subscriptionStatusStream ??= pangeaController + .subscriptionController.subscriptionStream.stream + .listen((_) { + showSubscribedSnackbar(context); + context.go('/rooms'); + }); return SettingsSubscriptionView(this); } } diff --git a/lib/pangea/pages/settings_subscription/settings_subscription_view.dart b/lib/pangea/pages/settings_subscription/settings_subscription_view.dart index 708bd8d66..33ed15ff2 100644 --- a/lib/pangea/pages/settings_subscription/settings_subscription_view.dart +++ b/lib/pangea/pages/settings_subscription/settings_subscription_view.dart @@ -1,14 +1,14 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_gen/gen_l10n/l10n.dart'; -import 'package:intl/intl.dart'; - +// Flutter imports: +// Project imports: import 'package:fluffychat/pangea/controllers/pangea_controller.dart'; import 'package:fluffychat/pangea/controllers/subscription_controller.dart'; import 'package:fluffychat/pangea/pages/settings_subscription/change_subscription.dart'; import 'package:fluffychat/pangea/pages/settings_subscription/settings_subscription.dart'; import 'package:fluffychat/widgets/layouts/max_width_body.dart'; import 'package:fluffychat/widgets/matrix.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:intl/intl.dart'; class SettingsSubscriptionView extends StatelessWidget { final SubscriptionManagementController controller; @@ -105,45 +105,44 @@ class ManagementNotAvailableWarning extends StatelessWidget { @override Widget build(BuildContext context) { - final bool currentSubscriptionAvailable = - controller.currentSubscriptionAvailable; - final bool currentSubscriptionIsPromotional = - controller.currentSubscriptionIsPromotional; - final String? purchasePlatformDisplayName = - controller.purchasePlatformDisplayName; - final bool isLifetimeSubscription = - subscriptionController.subscription?.isLifetimeSubscription ?? false; - final DateTime? expirationDate = - subscriptionController.subscription?.expirationDate; - - String warningText = L10n.of(context)!.subscriptionManagementUnavailable; - final DateFormat formatter = DateFormat('yyyy-MM-dd'); - - if (currentSubscriptionAvailable) { - warningText = L10n.of(context)!.subsciptionPlatformTooltip; - } else if (currentSubscriptionIsPromotional) { - if (isLifetimeSubscription) { - warningText = L10n.of(context)!.promotionalSubscriptionDesc; - } else { - warningText = L10n.of(context)!.promoSubscriptionExpirationDesc( - formatter.format(expirationDate!), + String getWarningText() { + final DateFormat formatter = DateFormat('yyyy-MM-dd'); + if (controller.isNewUserTrial) { + return L10n.of(context)!.trialExpiration( + formatter.format( + subscriptionController.subscription!.expirationDate!, + ), + ); + } + if (controller.currentSubscriptionAvailable) { + String warningText = L10n.of(context)!.subsciptionPlatformTooltip; + if (controller.purchasePlatformDisplayName != null) { + warningText += + "\n${L10n.of(context)!.originalSubscriptionPlatform(controller.purchasePlatformDisplayName!)}"; + } + return warningText; + } + if (controller.currentSubscriptionIsPromotional) { + if (subscriptionController.subscription?.isLifetimeSubscription ?? + false) { + return L10n.of(context)!.promotionalSubscriptionDesc; + } + return L10n.of(context)!.promoSubscriptionExpirationDesc( + formatter.format( + subscriptionController.subscription!.expirationDate!, + ), ); } + return L10n.of(context)!.subscriptionManagementUnavailable; } return Center( - child: Column( - children: [ - Text( - warningText, - textAlign: TextAlign.center, - ), - if (purchasePlatformDisplayName != null) - Text( - "${L10n.of(context)!.originalSubscriptionPlatform} $purchasePlatformDisplayName", - textAlign: TextAlign.center, - ), - ], + child: Padding( + padding: const EdgeInsets.all(20), + child: Text( + getWarningText(), + textAlign: TextAlign.center, + ), ), ); } diff --git a/lib/pangea/widgets/class/add_space_toggles.dart b/lib/pangea/widgets/class/add_space_toggles.dart index 7409a2355..ca9cba14e 100644 --- a/lib/pangea/widgets/class/add_space_toggles.dart +++ b/lib/pangea/widgets/class/add_space_toggles.dart @@ -1,15 +1,12 @@ -import 'dart:math'; - -import 'package:flutter/material.dart'; - import 'package:collection/collection.dart'; +import 'package:fluffychat/config/app_config.dart'; +import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart'; +import 'package:fluffychat/pangea/utils/error_handler.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:future_loading_dialog/future_loading_dialog.dart'; import 'package:matrix/matrix.dart'; -import 'package:fluffychat/config/app_config.dart'; -import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart'; -import 'package:fluffychat/pangea/utils/error_handler.dart'; import '../../../widgets/matrix.dart'; import '../../utils/firebase_analytics.dart'; import 'add_class_and_invite.dart'; @@ -192,24 +189,49 @@ class AddToSpaceState extends State { ), ), ), - if (parents.any((r) => r.room.id == possibleParent.id)) - SwitchListTile.adaptive( - title: Text( - L10n.of(context)!.suggestTo(possibleParentName), - style: TextStyle( - color: Theme.of(context).colorScheme.secondary, - ), - ), - subtitle: Text( - widget.mode == AddToClassMode.chat - ? L10n.of(context)!.suggestChatDesc(possibleParentName) - : L10n.of(context)!.suggestExchangeDesc(possibleParentName), - ), - activeColor: AppConfig.activeToggleColor, - value: isSuggestedInSpace(possibleParent), - onChanged: (bool suggest) => - setSuggested(suggest, possibleParent), - ), + AnimatedSize( + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + child: parents.any((r) => r.room.id == possibleParent.id) + ? SwitchListTile.adaptive( + title: Row( + children: [ + const SizedBox(width: 32), + Text( + L10n.of(context)!.suggestTo(possibleParentName), + style: TextStyle( + color: Theme.of(context).colorScheme.secondary, + ), + ), + ], + ), + subtitle: Row( + children: [ + const SizedBox(width: 32), + Expanded( + child: Text( + widget.mode == AddToClassMode.chat + ? L10n.of(context)! + .suggestChatDesc(possibleParentName) + : L10n.of(context)!.suggestExchangeDesc( + possibleParentName, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + activeColor: AppConfig.activeToggleColor, + value: isSuggestedInSpace(possibleParent), + onChanged: (bool suggest) => + setSuggested(suggest, possibleParent), + ) + : Container(), + ), + Divider( + height: 0.5, + color: Theme.of(context).colorScheme.secondary.withAlpha(25), + ), ], ), ); @@ -223,7 +245,6 @@ class AddToSpaceState extends State { final String subtitle = widget.mode == AddToClassMode.exchange ? L10n.of(context)!.addToClassDesc : L10n.of(context)!.addToClassOrExchangeDesc; - final scrollController = ScrollController(); return Column( children: [ @@ -253,27 +274,10 @@ class AddToSpaceState extends State { if (isOpen) ...[ const Divider(height: 1), possibleParents.isNotEmpty - ? Scrollbar( - controller: scrollController, - thumbVisibility: true, - child: SingleChildScrollView( - controller: scrollController, - child: Column( - children: [ - const Divider(height: 1), - SizedBox( - height: min(possibleParents.length * 55, 500), - child: ListView.builder( - shrinkWrap: true, - itemCount: possibleParents.length, - itemBuilder: (BuildContext context, int i) { - return getAddToSpaceToggleItem(i); - }, - ), - ), - ], - ), - ), + ? Column( + children: possibleParents + .mapIndexed((index, _) => getAddToSpaceToggleItem(index)) + .toList(), ) : Center( child: Padding( diff --git a/lib/pangea/widgets/subscription/subscription_options.dart b/lib/pangea/widgets/subscription/subscription_options.dart index e82123638..81073a0b5 100644 --- a/lib/pangea/widgets/subscription/subscription_options.dart +++ b/lib/pangea/widgets/subscription/subscription_options.dart @@ -1,10 +1,11 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_gen/gen_l10n/l10n.dart'; - +// Flutter imports: +// Project imports: import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/pangea/controllers/pangea_controller.dart'; import 'package:fluffychat/pangea/controllers/subscription_controller.dart'; +import 'package:flutter/material.dart'; +// Package imports: +import 'package:flutter_gen/gen_l10n/l10n.dart'; class SubscriptionOptions extends StatelessWidget { final PangeaController pangeaController; @@ -16,23 +17,18 @@ class SubscriptionOptions extends StatelessWidget { @override Widget build(BuildContext context) { return Expanded( - child: ListView( - children: [ - const SizedBox(height: 20), - Wrap( - alignment: WrapAlignment.center, - direction: Axis.horizontal, - children: pangeaController - .subscriptionController.subscription!.availableSubscriptions - .map( - (subscription) => SubscriptionCard( - subscription: subscription, - pangeaController: pangeaController, - ), - ) - .toList(), - ), - ], + child: Wrap( + alignment: WrapAlignment.center, + direction: Axis.horizontal, + children: pangeaController + .subscriptionController.subscription!.availableSubscriptions + .map( + (subscription) => SubscriptionCard( + subscription: subscription, + pangeaController: pangeaController, + ), + ) + .toList(), ), ); } @@ -80,7 +76,11 @@ class SubscriptionCard extends StatelessWidget { OutlinedButton( onPressed: () { pangeaController.subscriptionController - .submitSubscriptionChange(subscription, context); + .submitSubscriptionChange( + subscription, + context, + ); + Navigator.of(context).pop(); }, child: Text(L10n.of(context)!.subscribe), ), diff --git a/lib/pangea/widgets/subscription/subscription_paywall.dart b/lib/pangea/widgets/subscription/subscription_paywall.dart index 0686d38b8..d68b35a83 100644 --- a/lib/pangea/widgets/subscription/subscription_paywall.dart +++ b/lib/pangea/widgets/subscription/subscription_paywall.dart @@ -1,9 +1,10 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_gen/gen_l10n/l10n.dart'; - +// Flutter imports: +// Project imports: +import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/pangea/controllers/pangea_controller.dart'; import 'package:fluffychat/pangea/widgets/subscription/subscription_options.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/l10n.dart'; class SubscriptionPaywall extends StatelessWidget { final PangeaController pangeaController; @@ -28,7 +29,7 @@ class SubscriptionPaywall extends StatelessWidget { ), body: Padding( padding: const EdgeInsets.all(20), - child: Column( + child: ListView( children: [ if (pangeaController.matrixState.client.rooms.length > 1) ...[ Text( @@ -44,12 +45,65 @@ class SubscriptionPaywall extends StatelessWidget { style: const TextStyle(fontSize: 16), ), const SizedBox(height: 20), - SubscriptionOptions( - pangeaController: pangeaController, - ), + pangeaController.userController.inTrialWindow + ? FreeTrialCard( + pangeaController: pangeaController, + ) + : SubscriptionOptions( + pangeaController: pangeaController, + ), ], ), ), ); } } + +class FreeTrialCard extends StatelessWidget { + final PangeaController pangeaController; + const FreeTrialCard({super.key, required this.pangeaController}); + + @override + Widget build(BuildContext context) { + return Align( + child: Card( + shape: RoundedRectangleBorder( + side: BorderSide( + color: AppConfig.primaryColorLight.withAlpha(64), + ), + borderRadius: const BorderRadius.all(Radius.zero), + ), + child: SizedBox( + height: 250, + width: AppConfig.columnWidth * 0.75, + child: Padding( + padding: const EdgeInsets.all(25), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + L10n.of(context)!.freeTrial, + textAlign: TextAlign.center, + style: const TextStyle(fontSize: 24), + ), + Text( + L10n.of(context)!.freeTrialDesc, + textAlign: TextAlign.center, + ), + OutlinedButton( + onPressed: () { + pangeaController.subscriptionController + .activateNewUserTrial(); + Navigator.of(context).pop(); + }, + child: Text(L10n.of(context)!.activateTrial), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pangea/widgets/subscription/subscription_snackbar.dart b/lib/pangea/widgets/subscription/subscription_snackbar.dart new file mode 100644 index 000000000..46283a8be --- /dev/null +++ b/lib/pangea/widgets/subscription/subscription_snackbar.dart @@ -0,0 +1,34 @@ +import 'package:fluffychat/config/app_config.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/l10n.dart'; +import 'package:go_router/go_router.dart'; + +void showSubscribedSnackbar(BuildContext context) { + final Widget text = RichText( + text: TextSpan( + children: [ + TextSpan( + text: L10n.of(context)!.successfullySubscribed, + style: TextStyle( + color: Theme.of(context).brightness == Brightness.light + ? Colors.white + : Colors.black, + ), + ), + const TextSpan(text: " "), + TextSpan( + text: L10n.of(context)!.clickToManageSubscription, + style: const TextStyle(color: AppConfig.primaryColor), + recognizer: TapGestureRecognizer() + ..onTap = () => context.go('/rooms/settings/subscription'), + ), + ], + ), + ); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: text, + ), + ); +} diff --git a/needed-translations.txt b/needed-translations.txt index 22219e8b3..12029f657 100644 --- a/needed-translations.txt +++ b/needed-translations.txt @@ -756,7 +756,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "bn": [ @@ -1521,7 +1526,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "bo": [ @@ -2286,7 +2296,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "ca": [ @@ -3046,7 +3061,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "cs": [ @@ -3806,7 +3826,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "de": [ @@ -4566,7 +4591,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "el": [ @@ -5331,7 +5361,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "eo": [ @@ -6091,7 +6126,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "es": [ @@ -6115,7 +6155,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "et": [ @@ -6875,7 +6920,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "eu": [ @@ -7635,7 +7685,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "fa": [ @@ -8395,7 +8450,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "fi": [ @@ -9155,7 +9215,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "fr": [ @@ -9915,7 +9980,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "ga": [ @@ -10675,7 +10745,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "gl": [ @@ -11435,7 +11510,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "he": [ @@ -12195,7 +12275,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "hi": [ @@ -12960,7 +13045,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "hr": [ @@ -13720,7 +13810,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "hu": [ @@ -14480,7 +14575,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "id": [ @@ -15240,7 +15340,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "ie": [ @@ -16002,7 +16107,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "it": [ @@ -16762,7 +16872,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "ja": [ @@ -17522,7 +17637,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "ko": [ @@ -18282,7 +18402,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "lt": [ @@ -19042,7 +19167,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "lv": [ @@ -19807,7 +19937,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "nb": [ @@ -20567,7 +20702,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "nl": [ @@ -21327,7 +21467,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "pl": [ @@ -22087,7 +22232,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "pt": [ @@ -22852,7 +23002,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "pt_BR": [ @@ -23612,7 +23767,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "pt_PT": [ @@ -24372,7 +24532,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "ro": [ @@ -25132,7 +25297,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "ru": [ @@ -25892,7 +26062,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "sk": [ @@ -26653,7 +26828,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "sl": [ @@ -27416,7 +27596,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "sr": [ @@ -28176,7 +28361,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "sv": [ @@ -28936,7 +29126,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "ta": [ @@ -29701,7 +29896,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "th": [ @@ -30466,7 +30666,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "tr": [ @@ -31226,7 +31431,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "uk": [ @@ -31986,7 +32196,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "vi": [ @@ -32749,7 +32964,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "zh": [ @@ -33509,7 +33729,12 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ], "zh_Hant": [ @@ -34269,6 +34494,11 @@ "groupName", "createGroupAndInviteUsers", "groupCanBeFoundViaSearch", - "inNoSpaces" + "trialExpiration", + "freeTrialDesc", + "activateTrial", + "inNoSpaces", + "successfullySubscribed", + "clickToManageSubscription" ] } diff --git a/pubspec.yaml b/pubspec.yaml index 890f39c6e..f10778925 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -133,7 +133,6 @@ flutter: generate: true uses-material-design: true assets: - - .env - assets/ - assets/pangea/ - assets/pangea/bot_faces/ diff --git a/scripts/build-web.sh b/scripts/build-web.sh index e4c85b254..8e46ed749 100755 --- a/scripts/build-web.sh +++ b/scripts/build-web.sh @@ -2,4 +2,5 @@ flutter config --enable-web flutter clean flutter pub get -flutter build web --release --verbose --source-maps --dart-define=SENTRY_RELEASE=$CI_COMMIT_SHA +flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --profile --source-maps --base-href "/client/" +# flutter build web --release --verbose --source-maps --dart-define=SENTRY_RELEASE=$CI_COMMIT_SHA