Rich text editor for Flutter
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class QuillIconButton extends StatelessWidget {
|
|
|
|
const QuillIconButton({
|
|
|
|
required this.onPressed,
|
|
|
|
this.icon,
|
|
|
|
this.size = 40,
|
|
|
|
this.fillColor,
|
|
|
|
this.hoverElevation = 1,
|
|
|
|
this.highlightElevation = 1,
|
|
|
|
this.borderRadius = 2,
|
|
|
|
Key? key,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
final VoidCallback? onPressed;
|
|
|
|
final Widget? icon;
|
|
|
|
final double size;
|
|
|
|
final Color? fillColor;
|
|
|
|
final double hoverElevation;
|
|
|
|
final double highlightElevation;
|
|
|
|
final double borderRadius;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ConstrainedBox(
|
|
|
|
constraints: BoxConstraints.tightFor(width: size, height: size),
|
|
|
|
child: RawMaterialButton(
|
|
|
|
visualDensity: VisualDensity.compact,
|
|
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(borderRadius)),
|
|
|
|
fillColor: fillColor,
|
|
|
|
elevation: 0,
|
|
|
|
hoverElevation: hoverElevation,
|
|
|
|
highlightElevation: hoverElevation,
|
|
|
|
onPressed: onPressed,
|
|
|
|
child: icon,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|