mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: polish upload image menu (#5928)
* chore: polish upload image menu * fix: text align issue --------- Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
parent
f7adcae8ff
commit
2bc7875bdd
@ -150,9 +150,16 @@ class _UploadImageMenuState extends State<UploadImageMenu> {
|
|||||||
final type = values[currentTabIndex];
|
final type = values[currentTabIndex];
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case UploadImageType.local:
|
case UploadImageType.local:
|
||||||
return Container(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(
|
||||||
|
color: Theme.of(context).colorScheme.outline,
|
||||||
|
),
|
||||||
|
),
|
||||||
constraints: constraints,
|
constraints: constraints,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@ -170,6 +177,7 @@ class _UploadImageMenuState extends State<UploadImageMenu> {
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
case UploadImageType.url:
|
case UploadImageType.url:
|
||||||
return Container(
|
return Container(
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||||
import 'package:appflowy/shared/patterns/common_patterns.dart';
|
import 'package:appflowy/shared/patterns/common_patterns.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class EmbedImageUrlWidget extends StatefulWidget {
|
class EmbedImageUrlWidget extends StatefulWidget {
|
||||||
const EmbedImageUrlWidget({
|
const EmbedImageUrlWidget({
|
||||||
@ -25,31 +24,38 @@ class _EmbedImageUrlWidgetState extends State<EmbedImageUrlWidget> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
|
const VSpace(12),
|
||||||
FlowyTextField(
|
FlowyTextField(
|
||||||
hintText: LocaleKeys.document_imageBlock_embedLink_placeholder.tr(),
|
hintText: LocaleKeys.document_imageBlock_embedLink_placeholder.tr(),
|
||||||
onChanged: (value) => inputText = value,
|
onChanged: (value) => inputText = value,
|
||||||
onEditingComplete: submit,
|
onEditingComplete: submit,
|
||||||
),
|
),
|
||||||
if (!isUrlValid) ...[
|
if (!isUrlValid) ...[
|
||||||
const VSpace(8),
|
const VSpace(12),
|
||||||
FlowyText(
|
FlowyText(
|
||||||
LocaleKeys.document_plugins_cover_invalidImageUrl.tr(),
|
LocaleKeys.document_plugins_cover_invalidImageUrl.tr(),
|
||||||
color: Theme.of(context).colorScheme.error,
|
color: Theme.of(context).colorScheme.error,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
const VSpace(8),
|
const VSpace(20),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 160,
|
height: 32,
|
||||||
|
width: 300,
|
||||||
child: FlowyButton(
|
child: FlowyButton(
|
||||||
|
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||||
|
hoverColor: Theme.of(context).colorScheme.primary.withOpacity(0.9),
|
||||||
showDefaultBoxDecorationOnMobile: true,
|
showDefaultBoxDecorationOnMobile: true,
|
||||||
margin: const EdgeInsets.all(8.0),
|
margin: const EdgeInsets.all(5),
|
||||||
text: FlowyText(
|
text: FlowyText(
|
||||||
LocaleKeys.document_imageBlock_embedLink_label.tr(),
|
LocaleKeys.document_imageBlock_embedLink_label.tr(),
|
||||||
|
lineHeight: 1,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
color: Theme.of(context).colorScheme.onPrimary,
|
||||||
),
|
),
|
||||||
onTap: submit,
|
onTap: submit,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const VSpace(8),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -448,7 +448,7 @@ Widget _slashMenuItemNameBuilder(
|
|||||||
SelectionMenuStyle style,
|
SelectionMenuStyle style,
|
||||||
bool isSelected,
|
bool isSelected,
|
||||||
) {
|
) {
|
||||||
return FlowyText(
|
return FlowyText.regular(
|
||||||
name,
|
name,
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
figmaLineHeight: 15.0,
|
figmaLineHeight: 15.0,
|
||||||
|
@ -167,10 +167,11 @@ class FlowyText extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
double? lineHeight;
|
double? lineHeight;
|
||||||
if (this.lineHeight != null) {
|
// use figma line height as first priority
|
||||||
lineHeight = this.lineHeight!;
|
if (figmaLineHeight != null) {
|
||||||
} else if (figmaLineHeight != null) {
|
|
||||||
lineHeight = figmaLineHeight! / fontSize;
|
lineHeight = figmaLineHeight! / fontSize;
|
||||||
|
} else if (this.lineHeight != null) {
|
||||||
|
lineHeight = this.lineHeight!;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEmoji && (_useNotoColorEmoji || Platform.isWindows)) {
|
if (isEmoji && (_useNotoColorEmoji || Platform.isWindows)) {
|
||||||
@ -210,7 +211,7 @@ class FlowyText extends StatelessWidget {
|
|||||||
textAlign: textAlign,
|
textAlign: textAlign,
|
||||||
overflow: overflow ?? TextOverflow.clip,
|
overflow: overflow ?? TextOverflow.clip,
|
||||||
style: textStyle,
|
style: textStyle,
|
||||||
strutStyle: (isEmoji && optimizeEmojiAlign)
|
strutStyle: !isEmoji || (isEmoji && optimizeEmojiAlign)
|
||||||
? StrutStyle.fromTextStyle(
|
? StrutStyle.fromTextStyle(
|
||||||
textStyle,
|
textStyle,
|
||||||
forceStrutHeight: true,
|
forceStrutHeight: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user