chore: upgrade flutter to 3.13.9 (#3936)

This commit is contained in:
Lucas.Xu
2023-11-14 22:33:07 +08:00
committed by GitHub
parent 1c500fbfc5
commit 6a9866b9d2
116 changed files with 312 additions and 260 deletions

View File

@ -1,9 +1,9 @@
import 'package:appflowy/plugins/base/emoji/emoji_picker_header.dart';
import 'package:appflowy/plugins/base/emoji/emoji_search_bar.dart';
import 'package:appflowy/plugins/base/emoji/emoji_skin_tone.dart';
import 'package:emoji_mart/emoji_mart.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_emoji_mart/flutter_emoji_mart.dart';
// use a global value to store the selected emoji to prevent reloading every time.
EmojiData? _cachedEmojiData;

View File

@ -1,7 +1,7 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:emoji_mart/emoji_mart.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_emoji_mart/flutter_emoji_mart.dart';
class FlowyEmojiHeader extends StatelessWidget {
const FlowyEmojiHeader({

View File

@ -1,6 +1,6 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:emoji_mart/emoji_mart.dart';
import 'package:flutter_emoji_mart/flutter_emoji_mart.dart';
class FlowyEmojiPickerI18n extends EmojiPickerI18n {
@override

View File

@ -3,10 +3,10 @@ import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/base/emoji/emoji_skin_tone.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:emoji_mart/emoji_mart.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
import 'package:flutter/material.dart';
import 'package:flutter_emoji_mart/flutter_emoji_mart.dart';
typedef EmojiKeywordChangedCallback = void Function(String keyword);
typedef EmojiSkinToneChanged = void Function(EmojiSkinTone skinTone);

View File

@ -1,10 +1,10 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:emoji_mart/emoji_mart.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/widget/flowy_tooltip.dart';
import 'package:flutter/material.dart';
import 'package:flutter_emoji_mart/flutter_emoji_mart.dart';
// use a temporary global value to store last selected skin tone
EmojiSkinTone? lastSelectedEmojiSkinTone;

View File

@ -111,7 +111,7 @@ class _FlowyIconPickerState extends State<FlowyIconPicker>
LocaleKeys.emoji_emojiTab.tr(),
),
),
)
),
],
),
);

View File

@ -219,7 +219,7 @@ class CellController<T, D> extends Equatable {
@override
List<Object> get props => [
_cellCache.get(_cacheKey) ?? "",
_cellContext.rowId + _cellContext.fieldInfo.id
_cellContext.rowId + _cellContext.fieldInfo.id,
];
}

View File

@ -392,7 +392,7 @@ class FieldController {
}
final List<FieldInfo> newFields = fieldInfos;
final Map<String, FieldIdPB> deletedFieldMap = {
for (final fieldOrder in deletedFields) fieldOrder.fieldId: fieldOrder
for (final fieldOrder in deletedFields) fieldOrder.fieldId: fieldOrder,
};
newFields.retainWhere((field) => (deletedFieldMap[field.id] == null));

View File

@ -100,7 +100,7 @@ class RowList {
final List<RowInfo> newRows = [];
final DeletedIndexs deletedIndex = [];
final Map<String, String> deletedRowByRowId = {
for (var rowId in rowIds) rowId: rowId
for (final rowId in rowIds) rowId: rowId,
};
_rowInfos.asMap().forEach((index, RowInfo rowInfo) {

View File

@ -1,5 +1,5 @@
import 'package:appflowy/plugins/database_view/tab_bar/tab_bar_view.dart';
import 'package:appflowy/plugins/database_view/tab_bar/tab_bar_add_button.dart';
import 'package:appflowy/plugins/database_view/tab_bar/tab_bar_view.dart';
import 'package:appflowy/workspace/application/view/prelude.dart';
import 'package:appflowy/workspace/application/view/view_ext.dart';
import 'package:appflowy_backend/log.dart';
@ -65,7 +65,8 @@ class DatabaseTabBarBloc
if (updatePB.createChildViews.isNotEmpty) {
final allTabBars = [
...state.tabBars,
...updatePB.createChildViews.map((e) => DatabaseTabBar(view: e))
...updatePB.createChildViews
.map((e) => DatabaseTabBar(view: e)),
];
emit(
state.copyWith(
@ -80,7 +81,7 @@ class DatabaseTabBarBloc
if (updatePB.deleteChildViews.isNotEmpty) {
final allTabBars = [...state.tabBars];
final tabBarControllerByViewId = {
...state.tabBarControllerByViewId
...state.tabBarControllerByViewId,
};
var newSelectedIndex = state.selectedIndex;
for (final viewId in updatePB.deleteChildViews) {
@ -235,7 +236,7 @@ class DatabaseTabBarState with _$DatabaseTabBarState {
tabBarControllerByViewId: {
view.id: DatabaseTabBarController(
view: view,
)
),
},
);
}

View File

@ -237,7 +237,7 @@ class _BoardColumnHeaderState extends State<BoardColumnHeader> {
),
),
),
)
),
],
);
},

View File

@ -431,7 +431,7 @@ class HiddenGroupPopupItemList extends StatelessWidget {
},
);
},
)
),
];
return ListView.separated(

View File

@ -283,7 +283,7 @@ class CalendarBloc extends Bloc<CalendarEvent, CalendarState> {
return;
}
fieldInfoByFieldId = {
for (var fieldInfo in fieldInfos) fieldInfo.field.id: fieldInfo
for (final fieldInfo in fieldInfos) fieldInfo.field.id: fieldInfo,
};
},
onRowsCreated: (rowIds) async {

View File

@ -230,7 +230,7 @@ class _EventCardState extends State<EventCard> {
color: Theme.of(context).hintColor,
overflow: TextOverflow.ellipsis,
),
)
),
],
),
),

View File

@ -435,7 +435,7 @@ class UnscheduleEventsList extends StatelessWidget {
PopoverContainer.of(context).close();
},
),
)
),
];
return ListView.separated(

View File

@ -50,7 +50,7 @@ class FieldTypeOptionEditor extends StatelessWidget {
final List<Widget> children = [
SwitchFieldButton(popoverMutex: popoverMutex),
if (typeOptionWidget != null) typeOptionWidget
if (typeOptionWidget != null) typeOptionWidget,
];
return ListView(

View File

@ -48,7 +48,7 @@ class SelectOptionTypeOptionWidget extends StatelessWidget {
const VSpace(10),
if (state.options.isEmpty && !state.isEditingOption)
const _AddOptionButton(),
_OptionList(popoverMutex: popoverMutex)
_OptionList(popoverMutex: popoverMutex),
];
return ListView.builder(
@ -77,7 +77,7 @@ class OptionTitle extends StatelessWidget {
child: FlowyText.medium(
LocaleKeys.grid_field_optionTitle.tr(),
),
)
),
];
if (state.options.isNotEmpty && !state.isEditingOption) {
children.add(const Spacer());

View File

@ -19,7 +19,7 @@ class GridShortcuts extends StatelessWidget {
}
Map<ShortcutActivator, Intent> bindKeys(List<LogicalKeyboardKey> keys) {
return {for (var key in keys) LogicalKeySet(key): KeyboardKeyIdent(key)};
return {for (final key in keys) LogicalKeySet(key): KeyboardKeyIdent(key)};
}
Map<Type, Action<Intent>> bindActions() {

View File

@ -123,7 +123,7 @@ class SelectOptionTag extends StatelessWidget {
FlowySvgs.close_s,
),
),
]
],
],
),
);

View File

@ -126,7 +126,7 @@ class _GridTextCellState extends GridEditableTextCell<GridTextCell> {
isDense: true,
),
),
)
),
],
),
),

View File

@ -265,13 +265,17 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
child: MobileFloatingToolbar(
editorState: editorState,
editorScrollController: editorScrollController,
toolbarBuilder: (context, anchor) {
toolbarBuilder: (context, anchor, closeToolbar) {
return AdaptiveTextSelectionToolbar.editable(
clipboardStatus: ClipboardStatus.pasteable,
onCopy: () => copyCommand.execute(editorState),
onCopy: () {
copyCommand.execute(editorState);
closeToolbar();
},
onCut: () => cutCommand.execute(editorState),
onPaste: () => pasteCommand.execute(editorState),
onSelectAll: () => selectAllCommand.execute(editorState),
onLiveTextInput: null,
anchors: TextSelectionToolbarAnchors(
primaryAnchor: anchor,
),

View File

@ -79,7 +79,7 @@ class BlockOptionButton extends StatelessWidget {
),
TextSpan(
text: LocaleKeys.document_plugins_optionAction_toOpenMenu.tr(),
)
),
],
),
onTap: () {

View File

@ -170,7 +170,7 @@ class _BuiltInPageWidgetState extends State<BuiltInPageWidget> {
}
controller.close();
},
)
),
],
);
}

View File

@ -84,7 +84,7 @@ extension InsertDatabase on EditorState {
MentionBlockKeys.mention: {
MentionBlockKeys.type: MentionType.page.name,
MentionBlockKeys.pageId: view.id,
}
},
},
);
}

View File

@ -44,13 +44,15 @@ void showLinkToPageMenu(
await editorState.insertReferencePage(viewPB, pageType);
linkToPageMenuEntry.remove();
} on FlowyError catch (e) {
Dialogs.show(
child: FlowyErrorPage.message(
e.msg,
howToFix: LocaleKeys.errorDialog_howToFixFallback.tr(),
),
context,
);
if (context.mounted) {
Dialogs.show(
child: FlowyErrorPage.message(
e.msg,
howToFix: LocaleKeys.errorDialog_howToFixFallback.tr(),
),
context,
);
}
}
},
),
@ -149,7 +151,7 @@ class _LinkToPageMenuState extends State<LinkToPageMenu> {
LogicalKeyboardKey.arrowUp,
LogicalKeyboardKey.arrowDown,
LogicalKeyboardKey.tab,
LogicalKeyboardKey.enter
LogicalKeyboardKey.enter,
];
if (!acceptedKeys.contains(event.logicalKey)) {

View File

@ -119,7 +119,7 @@ extension PasteNodes on EditorState {
if (nodes.last.children.isNotEmpty) {
return [
...path,
...calculatePath([0], nodes.last.children.toList())
...calculatePath([0], nodes.last.children.toList()),
];
}
return path;

View File

@ -19,7 +19,7 @@ const String kLocalImagesKey = 'local_images';
List<String> get builtInAssetImages => [
"assets/images/app_flowy_abstract_cover_1.jpg",
"assets/images/app_flowy_abstract_cover_2.jpg"
"assets/images/app_flowy_abstract_cover_2.jpg",
];
class ChangeCoverPopover extends StatefulWidget {

View File

@ -102,7 +102,7 @@ class ChangeCoverPopoverBloc
transaction.updateNode(node, {
DocumentHeaderBlockKeys.coverType: CoverType.none.toString(),
DocumentHeaderBlockKeys.icon:
node.attributes[DocumentHeaderBlockKeys.icon]
node.attributes[DocumentHeaderBlockKeys.icon],
});
return editorState.apply(transaction);
}

View File

@ -148,7 +148,7 @@ class _NetworkImageUrlInputState extends State<NetworkImageUrlInput> {
title: LocaleKeys.document_plugins_cover_add.tr(),
borderRadius: Corners.s8Border,
),
)
),
],
);
}
@ -322,7 +322,7 @@ class _CoverImagePreviewWidgetState extends State<CoverImagePreviewWidget> {
(l) => _buildImageDeleteButton(context),
(r) => Container(),
)
: Container()
: Container(),
],
);
}

View File

@ -173,7 +173,7 @@ class _DocumentHeaderNodeWidgetState extends State<DocumentHeaderNodeWidget> {
DocumentHeaderBlockKeys.coverDetails:
widget.node.attributes[DocumentHeaderBlockKeys.coverDetails],
DocumentHeaderBlockKeys.icon:
widget.node.attributes[DocumentHeaderBlockKeys.icon]
widget.node.attributes[DocumentHeaderBlockKeys.icon],
};
if (cover != null) {
attributes[DocumentHeaderBlockKeys.coverType] = cover.$1.toString();
@ -398,7 +398,7 @@ class DocumentCoverState extends State<DocumentCover> {
width: double.infinity,
child: _buildCoverImage(),
),
if (!isOverlayButtonsHidden) _buildCoverOverlayButtons(context)
if (!isOverlayButtonsHidden) _buildCoverOverlayButtons(context),
],
),
),

View File

@ -88,7 +88,7 @@ class _OpenAIImageWidgetState extends State<OpenAIImageWidget> {
);
},
),
)
),
],
);
}

View File

@ -104,7 +104,7 @@ class _StabilityAIImageWidgetState extends State<StabilityAIImageWidget> {
);
},
),
)
),
],
);
}

View File

@ -37,7 +37,7 @@ Future<void> _insertDateReference(EditorState editorState) async {
MentionBlockKeys.mention: {
MentionBlockKeys.type: MentionType.date.name,
MentionBlockKeys.date: DateTime.now().toIso8601String(),
}
},
},
);

View File

@ -157,7 +157,7 @@ class _AutoCompletionBlockComponentState
onKeep: _onExit,
onRewrite: _onRewrite,
onDiscard: _onDiscard,
)
),
],
],
),
@ -477,7 +477,7 @@ class AutoCompletionHeader extends StatelessWidget {
onTap: () async {
await openLearnMorePage();
},
)
),
],
);
}

View File

@ -18,7 +18,7 @@ class Loading {
children: [
Center(
child: CircularProgressIndicator(),
)
),
],
);
},

View File

@ -254,7 +254,7 @@ class _SmartEditInputWidgetState extends State<SmartEditInputWidget> {
onTap: () async {
await openLearnMorePage();
},
)
),
],
);
}

View File

@ -132,7 +132,7 @@ class EditorStyleCustomizer {
fontSize + 8,
fontSize + 4,
fontSize + 2,
fontSize
fontSize,
];
return TextStyle(
fontSize: fontSizes.elementAtOrNull(level - 1) ?? fontSize,

View File

@ -31,7 +31,7 @@ class ExportPageWidget extends StatelessWidget {
width: 100,
height: 30,
onPressed: onTap,
)
),
],
);
}

View File

@ -35,7 +35,7 @@ class DocumentMoreButton extends StatelessWidget {
BlocProvider.value(
value: context.read<DocumentAppearanceCubit>(),
child: const FontSizeSwitcher(),
)
),
],
),
);

View File

@ -124,7 +124,7 @@ class DateReferenceService {
MentionBlockKeys.mention: {
MentionBlockKeys.type: MentionType.date.name,
MentionBlockKeys.date: date.toIso8601String(),
}
},
},
);

View File

@ -109,7 +109,7 @@ class InlinePageReferenceService {
MentionBlockKeys.mention: {
MentionBlockKeys.type: MentionType.page.name,
MentionBlockKeys.pageId: view.id,
}
},
},
);

View File

@ -150,7 +150,7 @@ class ReminderReferenceService {
MentionBlockKeys.type: MentionType.reminder.name,
MentionBlockKeys.date: date.toIso8601String(),
MentionBlockKeys.uid: reminder.id,
}
},
},
);

View File

@ -226,7 +226,7 @@ class _InlineActionsHandlerState extends State<InlineActionsHandler> {
![
...moveKeys,
LogicalKeyboardKey.arrowLeft,
LogicalKeyboardKey.arrowRight
LogicalKeyboardKey.arrowRight,
].contains(event.logicalKey)) {
/// Prevents dismissal of context menu by notifying the parent
/// that the selection change occurred from the handler.

View File

@ -110,7 +110,7 @@ class _TrashPageState extends State<TrashPage> {
onTap: () =>
context.read<TrashBloc>().add(const TrashEvent.deleteAll()),
),
)
),
],
),
);