mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-08-26 10:38:13 +08:00
Workaround IconButton splash animation appearing on the back
Workaround for https://github.com/flutter/flutter/issues/30658 Fixes #460
This commit is contained in:
@ -96,7 +96,8 @@ class EditorBottomBar extends StatelessWidget {
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Visibility(
|
||||
child: addIcon,
|
||||
// Remove Material when https://github.com/flutter/flutter/issues/30658 is fixed
|
||||
child: Material(child: addIcon),
|
||||
visible: allowEdits,
|
||||
maintainSize: true,
|
||||
maintainAnimation: true,
|
||||
@ -126,7 +127,8 @@ class EditorBottomBar extends StatelessWidget {
|
||||
onPressed: redoAllowed ? onRedoSelected : null,
|
||||
),
|
||||
const Spacer(),
|
||||
menuIcon,
|
||||
// Remove Material when https://github.com/flutter/flutter/issues/30658 is fixed
|
||||
Material(child: menuIcon),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
),
|
||||
|
@ -34,32 +34,32 @@ class MarkdownToolBar extends StatelessWidget {
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
fork.IconButton(
|
||||
icon: Text('H1', style: style),
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
onPressed: () => _modifyCurrentLine('# '),
|
||||
),
|
||||
IconButton(
|
||||
fork.IconButton(
|
||||
icon: Text('I', style: style),
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
onPressed: () => _modifyCurrentWord('*'),
|
||||
),
|
||||
IconButton(
|
||||
fork.IconButton(
|
||||
icon: Text('B', style: style),
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
onPressed: () => _modifyCurrentWord('**'),
|
||||
),
|
||||
IconButton(
|
||||
fork.IconButton(
|
||||
icon: const FaIcon(FontAwesomeIcons.listUl),
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
onPressed: () => _modifyCurrentLine('- '),
|
||||
),
|
||||
IconButton(
|
||||
fork.IconButton(
|
||||
icon: const FaIcon(FontAwesomeIcons.listOl),
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
onPressed: () => _modifyCurrentLine('1. '),
|
||||
),
|
||||
IconButton(
|
||||
fork.IconButton(
|
||||
icon: const FaIcon(FontAwesomeIcons.tasks),
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
onPressed: () => _modifyCurrentLine('- [ ] '),
|
||||
|
@ -21,6 +21,9 @@ const double _kMinButtonSize = kMinInteractiveDimension;
|
||||
|
||||
/// A material design icon button.
|
||||
///
|
||||
/// The FORK adds onLongPressed and wraps it in Material because of
|
||||
/// https://github.com/flutter/flutter/issues/30658
|
||||
///
|
||||
/// An icon button is a picture printed on a [Material] widget that reacts to
|
||||
/// touches by filling with color (ink).
|
||||
///
|
||||
@ -374,7 +377,7 @@ class IconButton extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
return Semantics(
|
||||
var sem = Semantics(
|
||||
button: true,
|
||||
enabled: onPressed != null,
|
||||
child: InkResponse(
|
||||
@ -398,6 +401,7 @@ class IconButton extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
);
|
||||
return Material(child: sem);
|
||||
}
|
||||
|
||||
@override
|
||||
|
Reference in New Issue
Block a user