-
Notifications
You must be signed in to change notification settings - Fork 845
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ellet
committed
Dec 5, 2023
1 parent
b513bf2
commit b074484
Showing
15 changed files
with
30 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,32 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../../../utils/widgets.dart'; | ||
|
||
class QuillToolbarIconButton extends StatelessWidget { | ||
const QuillToolbarIconButton({ | ||
required this.onPressed, | ||
required this.icon, | ||
required this.isFilled, | ||
this.afterPressed, | ||
this.icon, | ||
this.size = 40, | ||
this.fillColor, | ||
this.hoverElevation = 1, | ||
this.highlightElevation = 1, | ||
this.borderRadius = 2, | ||
this.tooltip, | ||
super.key, | ||
}); | ||
|
||
final VoidCallback? onPressed; | ||
final VoidCallback? afterPressed; | ||
final Widget? icon; | ||
final Widget icon; | ||
|
||
final double size; | ||
final Color? fillColor; | ||
final double hoverElevation; | ||
final double highlightElevation; | ||
final double borderRadius; | ||
final String? tooltip; | ||
final bool isFilled; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ConstrainedBox( | ||
constraints: BoxConstraints.tightFor(width: size, height: size), | ||
child: UtilityWidgets.maybeTooltip( | ||
message: tooltip, | ||
child: RawMaterialButton( | ||
visualDensity: VisualDensity.compact, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(borderRadius), | ||
), | ||
fillColor: fillColor, | ||
elevation: 0, | ||
hoverElevation: hoverElevation, | ||
highlightElevation: hoverElevation, | ||
onPressed: () { | ||
onPressed?.call(); | ||
afterPressed?.call(); | ||
}, | ||
child: icon, | ||
), | ||
), | ||
if (isFilled) { | ||
return IconButton.filled(onPressed: onPressed, icon: icon); | ||
} | ||
return IconButton( | ||
onPressed: onPressed, | ||
icon: icon, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters