Wednesday, 26 June 2019

Flutter Keyword

flutter tutorial,flutter,flutter tutorial for beginners,flutter app,flutter tutorials,flutter sdk,tutorial,flutter course,learn flutter,flutter tutorial ios,flutter firebase tutorial,flutter widgets,flutter app development tutorial,flutter ios,flutter dart,flutter android,google flutter,flutter sdk tutorial,flutter tutorial app,google flutter tutorial,flutter sqflite tutorial,flutter tutorial deutsch,flutter tutorial android


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;