1 await
Using await helps us to reduce boilerplate codes. General form of
await await e (where e unary expression)
e.g. (await file.copy(newPath))
Await expressions evaluates e, SUspends currently running function until the result is ready (or until future is completed). Result of await expression is the completion of future.
Important point: you can use await only inside the async function.
2 Async
An async function is a function whose body is marked with an async modifier.When you call an async function, it immediately returns a Future, the body of the function is scheduled for execution later.
When the body has executed, the Future that was returned by the call is completed with the result. (Regardless error or response).
3 Flutter select image gallery or camera get path.
Flutter select image gallery or camera get path.
Future getimage() async { File image await
ImagePicker.pickimage(source: Image Source.gallery); print("Image path: " + image.path); }
4 Media query
var device Size =MediaQuery.of(context).size;deviceSize.height
device Size.width;