cpd_2022_zi/lib/widgets/buttons/text_icon_button.dart

30 lines
687 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
class TextIconButton extends StatelessWidget {
final String text;
final VoidCallback onPressed;
final IconData iconData;
const TextIconButton(
{super.key,
required this.text,
required this.onPressed,
required this.iconData});
@override
Widget build(BuildContext context) {
return SizedBox(
width: MediaQuery.of(context).size.width * 0.4,
child: FloatingActionButton.extended(
label: Text(text),
backgroundColor: Theme.of(context).colorScheme.primary,
icon: Icon(
iconData,
size: 24.0,
),
onPressed: onPressed,
),
);
}
}