From 96c641557f09ddbb7e6ddafbfb12d119bf799a7e Mon Sep 17 00:00:00 2001 From: ggurdin Date: Tue, 9 Jul 2024 15:57:03 -0400 Subject: [PATCH] Make create space/chat button float --- assets/l10n/intl_en.arb | 4 +- lib/pages/new_group/new_group_view.dart | 61 ++++++++++++++----------- lib/pages/new_space/new_space_view.dart | 61 ++++++++++++++----------- 3 files changed, 73 insertions(+), 53 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 7d853de70..be109614e 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -4109,5 +4109,7 @@ "continueText": "Continue", "deleteSubscriptionWarningTitle": "You have an active subscription", "deleteSubscriptionWarningBody": "Deleting your account will not automatically cancel your subscription.", - "manageSubscription": "Manage Subscription" + "manageSubscription": "Manage Subscription", + "createSpace": "Create space", + "createChat": "Create chat" } \ No newline at end of file diff --git a/lib/pages/new_group/new_group_view.dart b/lib/pages/new_group/new_group_view.dart index b8b43c3f1..84bfbfbc5 100644 --- a/lib/pages/new_group/new_group_view.dart +++ b/lib/pages/new_group/new_group_view.dart @@ -27,6 +27,15 @@ class NewGroupView extends StatelessWidget { ), title: Text(L10n.of(context)!.createGroup), ), + // #Pangea + floatingActionButton: FloatingActionButton.extended( + onPressed: controller.loading ? null : controller.submitAction, + icon: controller.loading ? null : const Icon(Icons.chat_bubble_outline), + label: controller.loading + ? const CircularProgressIndicator.adaptive() + : Text(L10n.of(context)!.createChat), + ), + // Pangea# body: MaxWidthBody( child: Column( mainAxisSize: MainAxisSize.min, @@ -134,33 +143,33 @@ class NewGroupView extends StatelessWidget { // value: !controller.publicGroup, // onChanged: null, // ), + // Padding( + // padding: const EdgeInsets.all(16.0), + // child: SizedBox( + // width: double.infinity, + // child: ElevatedButton( + // style: ElevatedButton.styleFrom( + // foregroundColor: Theme.of(context).colorScheme.onPrimary, + // backgroundColor: Theme.of(context).colorScheme.primary, + // ), + // onPressed: + // controller.loading ? null : controller.submitAction, + // child: controller.loading + // ? const LinearProgressIndicator() + // : Row( + // children: [ + // Expanded( + // child: Text( + // L10n.of(context)!.createGroupAndInviteUsers, + // ), + // ), + // Icon(Icons.adaptive.arrow_forward_outlined), + // ], + // ), + // ), + // ), + // ), // Pangea# - Padding( - padding: const EdgeInsets.all(16.0), - child: SizedBox( - width: double.infinity, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - foregroundColor: Theme.of(context).colorScheme.onPrimary, - backgroundColor: Theme.of(context).colorScheme.primary, - ), - onPressed: - controller.loading ? null : controller.submitAction, - child: controller.loading - ? const LinearProgressIndicator() - : Row( - children: [ - Expanded( - child: Text( - L10n.of(context)!.createGroupAndInviteUsers, - ), - ), - Icon(Icons.adaptive.arrow_forward_outlined), - ], - ), - ), - ), - ), AnimatedSize( duration: FluffyThemes.animationDuration, child: error == null diff --git a/lib/pages/new_space/new_space_view.dart b/lib/pages/new_space/new_space_view.dart index f8c7baf4e..22751a787 100644 --- a/lib/pages/new_space/new_space_view.dart +++ b/lib/pages/new_space/new_space_view.dart @@ -32,6 +32,15 @@ class NewSpaceView extends StatelessWidget { // Pangea# title: Text(L10n.of(context)!.createNewSpace), ), + // #Pangea + floatingActionButton: FloatingActionButton.extended( + onPressed: controller.loading ? null : controller.submitAction, + icon: controller.loading ? null : const Icon(Icons.workspaces_outlined), + label: controller.loading + ? const CircularProgressIndicator.adaptive() + : Text(L10n.of(context)!.createSpace), + ), + // Pangea# body: MaxWidthBody( child: Column( mainAxisSize: MainAxisSize.min, @@ -158,33 +167,33 @@ class NewSpaceView extends StatelessWidget { // value: controller.publicGroup, // onChanged: controller.setPublicGroup, // ), + // Padding( + // padding: const EdgeInsets.all(16.0), + // child: SizedBox( + // width: double.infinity, + // child: ElevatedButton( + // style: ElevatedButton.styleFrom( + // foregroundColor: Theme.of(context).colorScheme.onPrimary, + // backgroundColor: Theme.of(context).colorScheme.primary, + // ), + // onPressed: + // controller.loading ? null : controller.submitAction, + // child: controller.loading + // ? const LinearProgressIndicator() + // : Row( + // children: [ + // Expanded( + // child: Text( + // L10n.of(context)!.createNewSpace, + // ), + // ), + // Icon(Icons.adaptive.arrow_forward_outlined), + // ], + // ), + // ), + // ), + // ), // Pangea# - Padding( - padding: const EdgeInsets.all(16.0), - child: SizedBox( - width: double.infinity, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - foregroundColor: Theme.of(context).colorScheme.onPrimary, - backgroundColor: Theme.of(context).colorScheme.primary, - ), - onPressed: - controller.loading ? null : controller.submitAction, - child: controller.loading - ? const LinearProgressIndicator() - : Row( - children: [ - Expanded( - child: Text( - L10n.of(context)!.createNewSpace, - ), - ), - Icon(Icons.adaptive.arrow_forward_outlined), - ], - ), - ), - ), - ), ], ), ),