add dispose to files to remove controllers when not used

This commit is contained in:
2024-08-23 11:14:53 +02:00
parent fdc7e1dda3
commit 2ef8eb2b3c
45 changed files with 374 additions and 53 deletions

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
class MIHButton extends StatelessWidget {
class MIHButton extends StatefulWidget {
final void Function() onTap;
final String buttonText;
final Color buttonColor;
@@ -14,22 +14,33 @@ class MIHButton extends StatelessWidget {
required this.textColor,
});
@override
State<MIHButton> createState() => _MIHButtonState();
}
class _MIHButtonState extends State<MIHButton> {
@override
void dispose() {
// TODO: implement dispose
super.dispose();
}
@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: onTap,
onPressed: widget.onTap,
style: ElevatedButton.styleFrom(
backgroundColor: buttonColor,
backgroundColor: widget.buttonColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),
),
child: Text(
buttonText,
widget.buttonText,
style: TextStyle(
//fontWeight: FontWeight.bold,
fontSize: 20,
color: textColor,
color: widget.textColor,
fontWeight: FontWeight.bold,
),
),