import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
int _weight =60;
class RoundIconData extends StatefulWidget {
@override
_RoundIconDataState createState() => _RoundIconDataState();
}
class _RoundIconDataState extends State<RoundIconData> {
RoundIconData({@required this.icon,@required this.pressme});
final IconData icon;
final int pressme;
@override
Widget build(BuildContext context) {
return RawMaterialButton(
child: Icon(icon),
onPressed: (){
setState(() {
if(icon == FontAwesomeIcons.minus){
_weight--;
}
else{
_weight++
}
});
},
elevation: 6.0,
constraints: BoxConstraints.tightFor(
width: 56.0,
height: 56.0,
),
shape: CircleBorder(),
fillColor: Color(0xFF4C4F5E),
);
}
}
i am getting error while creating this.
What i Want
Custom widget with RawmaterialButton through which i can add icons. if i add icon.minus then my given private weight wants to be decremented else given private weights to be incremented
