Thanks in advance....
I have an App built with Flutter whereby the main.dart file has a void function. I have another dart file with a raised button that i would like to call the void function from the main.dart file
is this possible??
//This is the void in the main.dart file
void buildBottomSheet(double height, MedicineModel model) async {
var medicineId = await showModalBottomSheet(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(45), topRight: Radius.circular(45))),
context: context,
isScrollControlled: true,
builder: (context) {
return FadeAnimation(
.6,
AddMedicine(height, model.getDatabase(),
model.notificationManager),
);
});
if (medicineId != null) {
Fluttertoast.showToast(
msg: "Reminder Added!",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM_LEFT,
timeInSecForIosWeb: 1,
backgroundColor: Theme
.of(context)
.accentColor,
textColor: Colors.white,
fontSize: 20.0);
setState(() {});
}
} //and then a raised button in a different .dart file to call this void?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…