40 lines
925 B
Dart
40 lines
925 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class Chips extends StatefulWidget {
|
|
const Chips({
|
|
super.key,
|
|
required this.buttonText,
|
|
required this.buttonStyle,
|
|
required this.bgColor,
|
|
this.onPressed,
|
|
});
|
|
final String buttonText;
|
|
final TextStyle buttonStyle;
|
|
final Color bgColor;
|
|
final VoidCallback? onPressed;
|
|
|
|
@override
|
|
State<Chips> createState() => _ChipsState();
|
|
}
|
|
|
|
class _ChipsState extends State<Chips> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: () {
|
|
widget.onPressed;
|
|
},
|
|
child: Container(
|
|
width: 129,
|
|
height: 48,
|
|
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 14),
|
|
decoration: BoxDecoration(
|
|
color: widget.bgColor,
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: Text(widget.buttonText, style: widget.buttonStyle),
|
|
),
|
|
);
|
|
}
|
|
}
|