add dispose to files to remove controllers when not used
This commit is contained in:
@@ -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,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user