Friday, September 14, 2018

The Flutter Widget Framework

The minimal flutter app looks like the below
Import package:flutter/material.dart

void main(){
   runApp(
       Center (child:Text("Hello world",textDirection:TextDirection.ltr)
        )
    )
}


The runApp take given widget and makes it as the root of the widget. The framework forces the root widget to cover the screen in which case Center which is a widget is converting the entire screen.

When writing the app, one will commonly author new widget by subclassing either Stateless Widget or Stateful widget. A widget's main job is to implement a build function which describes the widget in terms of other, lower-level widgets.

References:
https://flutter.io/widgets-intro/

No comments:

Post a Comment