community
community copied to clipboard
MaterialMaterialPageRoute bulider
MaterialPageRoute(
builder: (context) => ScanQR(),
)
i want to know why i can't type ScanQR() or ScanQR(context) and why to use () =>
The builder requires a function that takes a BuildContext and returns a Widget.
Passing in ScanQR() would return just Widget.
This is not what the builder wants as Widget != (BuildContext) => Widget.