mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: embed link button ui on mobile
This commit is contained in:
parent
7c93a0ab14
commit
cd45a09e83
@ -142,8 +142,10 @@ class _UploadImageMenuState extends State<UploadImageMenu> {
|
||||
);
|
||||
} else {
|
||||
child = Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8.0,
|
||||
vertical: 12.0,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/shared/patterns/common_patterns.dart';
|
||||
import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -22,13 +23,26 @@ class _EmbedImageUrlWidgetState extends State<EmbedImageUrlWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
const VSpace(12),
|
||||
FlowyTextField(
|
||||
final textField = FlowyTextField(
|
||||
hintText: LocaleKeys.document_imageBlock_embedLink_placeholder.tr(),
|
||||
onChanged: (value) => inputText = value,
|
||||
onEditingComplete: submit,
|
||||
textStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
fontSize: 14,
|
||||
),
|
||||
hintStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Theme.of(context).hintColor,
|
||||
fontSize: 14,
|
||||
),
|
||||
);
|
||||
return Column(
|
||||
children: [
|
||||
const VSpace(12),
|
||||
PlatformExtension.isDesktop
|
||||
? textField
|
||||
: SizedBox(
|
||||
height: 42,
|
||||
child: textField,
|
||||
),
|
||||
if (!isUrlValid) ...[
|
||||
const VSpace(12),
|
||||
@ -39,18 +53,23 @@ class _EmbedImageUrlWidgetState extends State<EmbedImageUrlWidget> {
|
||||
],
|
||||
const VSpace(20),
|
||||
SizedBox(
|
||||
height: 32,
|
||||
height: PlatformExtension.isMobile ? 36 : 32,
|
||||
width: 300,
|
||||
child: FlowyButton(
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
hoverColor: Theme.of(context).colorScheme.primary.withOpacity(0.9),
|
||||
showDefaultBoxDecorationOnMobile: true,
|
||||
radius:
|
||||
PlatformExtension.isMobile ? BorderRadius.circular(8) : null,
|
||||
margin: const EdgeInsets.all(5),
|
||||
text: FlowyText(
|
||||
LocaleKeys.document_imageBlock_embedLink_label.tr(),
|
||||
lineHeight: 1,
|
||||
textAlign: TextAlign.center,
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
color: PlatformExtension.isMobile
|
||||
? null
|
||||
: Theme.of(context).colorScheme.onPrimary,
|
||||
fontSize: PlatformExtension.isMobile ? 14 : null,
|
||||
),
|
||||
onTap: submit,
|
||||
),
|
||||
|
@ -24,7 +24,7 @@ class UploadImageFileWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final child = FlowyButton(
|
||||
Widget child = FlowyButton(
|
||||
showDefaultBoxDecorationOnMobile: true,
|
||||
radius: PlatformExtension.isMobile ? BorderRadius.circular(8.0) : null,
|
||||
text: Container(
|
||||
@ -38,7 +38,12 @@ class UploadImageFileWidget extends StatelessWidget {
|
||||
);
|
||||
|
||||
if (PlatformExtension.isDesktopOrWeb) {
|
||||
return FlowyHover(child: child);
|
||||
child = FlowyHover(child: child);
|
||||
} else {
|
||||
child = Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
return child;
|
||||
|
@ -264,7 +264,7 @@ class FlowyButton extends StatelessWidget {
|
||||
? BoxDecoration(
|
||||
border: Border.all(
|
||||
color: borderColor ??
|
||||
Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
Theme.of(context).colorScheme.outline,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: radius,
|
||||
|
Loading…
Reference in New Issue
Block a user