|
@@ -8,7 +8,6 @@ import 'package:flowy_infra_ui/style_widget/button.dart';
|
|
|
import 'package:flowy_infra_ui/style_widget/text.dart';
|
|
|
import 'package:flowy_infra_ui/widget/spacing.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
-import 'package:flutter/services.dart';
|
|
|
import 'package:appflowy/generated/locale_keys.g.dart';
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
import 'package:http/http.dart' as http;
|
|
@@ -99,28 +98,16 @@ class _SmartEditInputState extends State<_SmartEditInput> {
|
|
|
}
|
|
|
|
|
|
Widget _buildSmartEditPanel(BuildContext context) {
|
|
|
- return RawKeyboardListener(
|
|
|
- focusNode: focusNode,
|
|
|
- onKey: (RawKeyEvent event) async {
|
|
|
- if (event is! RawKeyDownEvent) return;
|
|
|
- if (event.logicalKey == LogicalKeyboardKey.enter) {
|
|
|
- await _onReplace();
|
|
|
- await _onExit();
|
|
|
- } else if (event.logicalKey == LogicalKeyboardKey.escape) {
|
|
|
- await _onExit();
|
|
|
- }
|
|
|
- },
|
|
|
- child: Column(
|
|
|
- mainAxisSize: MainAxisSize.min,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- _buildHeaderWidget(context),
|
|
|
- const Space(0, 10),
|
|
|
- _buildResultWidget(context),
|
|
|
- const Space(0, 10),
|
|
|
- _buildInputFooterWidget(context),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ return Column(
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ _buildHeaderWidget(context),
|
|
|
+ const Space(0, 10),
|
|
|
+ _buildResultWidget(context),
|
|
|
+ const Space(0, 10),
|
|
|
+ _buildInputFooterWidget(context),
|
|
|
+ ],
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -178,12 +165,6 @@ class _SmartEditInputState extends State<_SmartEditInput> {
|
|
|
text: '${LocaleKeys.button_replace.tr()} ',
|
|
|
style: Theme.of(context).textTheme.bodyMedium,
|
|
|
),
|
|
|
- TextSpan(
|
|
|
- text: '↵',
|
|
|
- style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
|
- color: Colors.grey,
|
|
|
- ),
|
|
|
- ),
|
|
|
],
|
|
|
),
|
|
|
onPressed: () {
|
|
@@ -199,12 +180,6 @@ class _SmartEditInputState extends State<_SmartEditInput> {
|
|
|
text: '${LocaleKeys.button_Cancel.tr()} ',
|
|
|
style: Theme.of(context).textTheme.bodyMedium,
|
|
|
),
|
|
|
- TextSpan(
|
|
|
- text: LocaleKeys.button_esc.tr(),
|
|
|
- style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
|
- color: Colors.grey,
|
|
|
- ),
|
|
|
- ),
|
|
|
],
|
|
|
),
|
|
|
onPressed: () async => await _onExit(),
|