fix: don't rebuild mobile toolbar everytime (#579)

This commit is contained in:
Lucas.Xu 2023-11-07 14:16:51 +08:00 • committed by GitHub
commit a47fc6fc71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -71,7 +71,7 @@ class MobileToolbar extends StatelessWidget {
buttonSelectedBorderWidth: buttonSelectedBorderWidth,
child: MobileToolbarWidget(
// Use selection as key to force rebuild toolbar widget when selection changed.
key: ValueKey(selection),
// key: ValueKey(selection),
editorState: editorState,
selection: selection,
toolbarItems: toolbarItems,

View file

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
typedef MobileToolbarItemMenuBuilder = Widget Function(
EditorState editorState,
Selection selection,
// To accees to the state of MobileToolbarWidget
// To access to the state of MobileToolbarWidget
MobileToolbarWidgetService service,
);