mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-26 03:54:15 +01:00
refactor: New private chat
This commit is contained in:
parent
1e1e591d27
commit
fff3dc9946
@ -26,49 +26,22 @@ class NewPrivateChatView extends StatelessWidget {
|
|||||||
title: Text(L10n.of(context)!.newChat),
|
title: Text(L10n.of(context)!.newChat),
|
||||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: TextButton(
|
||||||
onPressed: () => VRouter.of(context).to('/newgroup'),
|
onPressed: () => VRouter.of(context).to('/newgroup'),
|
||||||
child: Text(
|
child: Text(
|
||||||
L10n.of(context)!.createNewGroup,
|
L10n.of(context)!.createNewGroup,
|
||||||
style: TextStyle(color: Theme.of(context).colorScheme.secondary),
|
style:
|
||||||
|
TextStyle(color: Theme.of(context).colorScheme.secondary),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: MaxWidthBody(
|
body: MaxWidthBody(
|
||||||
withScrolling: true,
|
withScrolling: true,
|
||||||
child: Column(
|
child: Container(
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
|
||||||
child: Form(
|
|
||||||
key: controller.formKey,
|
|
||||||
child: TextFormField(
|
|
||||||
controller: controller.controller,
|
|
||||||
autocorrect: false,
|
|
||||||
autofocus: !PlatformInfos.isMobile,
|
|
||||||
textInputAction: TextInputAction.go,
|
|
||||||
focusNode: controller.textFieldFocus,
|
|
||||||
onFieldSubmitted: controller.submitAction,
|
|
||||||
validator: controller.validateForm,
|
|
||||||
inputFormatters: controller.removeMatrixToFormatters,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
contentPadding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 12,
|
|
||||||
vertical: 6,
|
|
||||||
),
|
|
||||||
labelText: L10n.of(context)!.typeInInviteLinkManually,
|
|
||||||
hintText: '@username',
|
|
||||||
prefixText: NewPrivateChatController.prefixNoProtocol,
|
|
||||||
suffixIcon: IconButton(
|
|
||||||
icon: const Icon(Icons.send_outlined),
|
|
||||||
onPressed: controller.submitAction,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
margin: const EdgeInsets.all(_qrCodePadding),
|
margin: const EdgeInsets.all(_qrCodePadding),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
padding: const EdgeInsets.all(_qrCodePadding * 2),
|
padding: const EdgeInsets.all(_qrCodePadding * 2),
|
||||||
@ -97,7 +70,36 @@ class NewPrivateChatView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
|
bottomNavigationBar: MaxWidthBody(
|
||||||
|
withScrolling: false,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
child: Form(
|
||||||
|
key: controller.formKey,
|
||||||
|
child: TextFormField(
|
||||||
|
controller: controller.controller,
|
||||||
|
autocorrect: false,
|
||||||
|
textInputAction: TextInputAction.go,
|
||||||
|
focusNode: controller.textFieldFocus,
|
||||||
|
onFieldSubmitted: controller.submitAction,
|
||||||
|
validator: controller.validateForm,
|
||||||
|
inputFormatters: controller.removeMatrixToFormatters,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 12,
|
||||||
|
vertical: 6,
|
||||||
|
),
|
||||||
|
labelText: L10n.of(context)!.typeInInviteLinkManually,
|
||||||
|
hintText: '@username',
|
||||||
|
prefixText: NewPrivateChatController.prefixNoProtocol,
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: const Icon(Icons.send_outlined),
|
||||||
|
onPressed: controller.submitAction,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
||||||
|
@ -11,7 +11,6 @@ class ContentBanner extends StatelessWidget {
|
|||||||
final void Function()? onEdit;
|
final void Function()? onEdit;
|
||||||
final Client? client;
|
final Client? client;
|
||||||
final double opacity;
|
final double opacity;
|
||||||
final String heroTag;
|
|
||||||
|
|
||||||
const ContentBanner(
|
const ContentBanner(
|
||||||
{this.mxContent,
|
{this.mxContent,
|
||||||
@ -20,7 +19,6 @@ class ContentBanner extends StatelessWidget {
|
|||||||
this.onEdit,
|
this.onEdit,
|
||||||
this.client,
|
this.client,
|
||||||
this.opacity = 0.75,
|
this.opacity = 0.75,
|
||||||
this.heroTag = 'content_banner',
|
|
||||||
Key? key})
|
Key? key})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
@ -42,15 +40,12 @@ class ContentBanner extends StatelessWidget {
|
|||||||
bottom: 0,
|
bottom: 0,
|
||||||
child: Opacity(
|
child: Opacity(
|
||||||
opacity: opacity,
|
opacity: opacity,
|
||||||
child: Hero(
|
|
||||||
tag: heroTag,
|
|
||||||
child: mxContent == null
|
child: mxContent == null
|
||||||
? Center(
|
? Center(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
defaultIcon,
|
defaultIcon,
|
||||||
color: Theme.of(context)
|
color:
|
||||||
.colorScheme
|
Theme.of(context).colorScheme.onSecondaryContainer,
|
||||||
.onSecondaryContainer,
|
|
||||||
size: 128,
|
size: 128,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -64,13 +59,13 @@ class ContentBanner extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
if (onEdit != null)
|
if (onEdit != null)
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.all(8),
|
margin: const EdgeInsets.all(8),
|
||||||
alignment: Alignment.bottomRight,
|
alignment: Alignment.bottomRight,
|
||||||
child: FloatingActionButton(
|
child: FloatingActionButton(
|
||||||
mini: true,
|
mini: true,
|
||||||
|
heroTag: null,
|
||||||
onPressed: onEdit,
|
onPressed: onEdit,
|
||||||
backgroundColor: Theme.of(context).backgroundColor,
|
backgroundColor: Theme.of(context).backgroundColor,
|
||||||
foregroundColor: Theme.of(context).textTheme.bodyText1?.color,
|
foregroundColor: Theme.of(context).textTheme.bodyText1?.color,
|
||||||
|
Loading…
Reference in New Issue
Block a user