Skip to content

Commit

Permalink
Add onImagePressed parameter to FleatherToolbar to handle image relat…
Browse files Browse the repository at this point in the history
…ed functions.
  • Loading branch information
yzxh24 committed Oct 5, 2024
1 parent 3c0d5eb commit dabf2a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/fleather/lib/src/widgets/editor_toolbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ class FleatherToolbar extends StatefulWidget implements PreferredSizeWidget {
bool hideHorizontalRule = false,
bool hideDirection = false,
bool hideUndoRedo = false,
VoidCallback? onImagePressed,
List<Widget> leading = const <Widget>[],
List<Widget> trailing = const <Widget>[],
bool hideAlignment = false,
Expand Down Expand Up @@ -1122,6 +1123,14 @@ class FleatherToolbar extends StatefulWidget implements PreferredSizeWidget {
Visibility(
visible: !hideLink, child: LinkStyleButton(controller: controller)),
Visibility(
visible: onImagePressed != null,
child: FLIconButton(
size: 32,
onPressed: onImagePressed,
icon: const Icon(Icons.image_outlined, size: 18),
),
),
Visibility(
visible: !hideHorizontalRule,
child: InsertEmbedButton(
Expand Down

0 comments on commit dabf2a4

Please sign in to comment.