Posts

Showing posts from May, 2020

USING THEMES TO STYLE YOUR APP

Image
USING THEMES TO STYLE YOUR APP The theme widgets are a great way to style and define global colors and font styles for your app. There are two ways to use theme widgets—to style the look and feel globally or to style just a portion of the app. For instance, you can use themes to style the color brightness (light text on a dark background or vice versa); the primary and accent colors; the canvas color; and the color of app bars, cards, dividers, selected and unselected options, buttons, hints, errors, text, icons, and so on. Using a Global App Theme  When the project is created the default theme color of  our application is blue and canvas color is White. To change the theme of your application we use the 'theme' property in material App that is your entry point of your GUI or Application.  See the Below code to change the of your app: class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build (BuildContext context) { r

Understanding the widget tree and element tree

Image
Understanding the Widget tree and Element tree: Widget tree : Widget tree are the collection of different widgets that are use to build the application. Widget contain the instructions to create the UI and when you compose widgets  together they create widget tree. In flutter every thing is widgets mans that when the application is run it call the runApp() method .Basically we taking StatelessWidget as the argument and mounted as root element for the application.Then flutter framework processes through all the widgets and corresponding elements is mounted. void   main () =>  runApp ( MyApp ()); class   MyApp   extends   StatelessWidget  {    // This widget is the root of your application.    @override    Widget   build ( BuildContext  context) {      return   MaterialApp ( debugShowCheckedModeBanner:  false ,  home:  MainPage ());   } } Element tree: Element tree are the collection of the child widget like Icons,Text. Element tree are the

Types of widgets and there Life Cycle

Image
Types of widgets and there Life Cycle: Mainly two type of widgets in flutter using these widgets we can create stunning app. The widgets are as follow: Stateless widgets. State full widgets. Stateless widgets: Stateless widget are the widgets that do not chance there state like text, image,etc. A State less widgets are use when the value not change. For example, the screen displays an image with a description and will not change . The Basic Structure of Stateless widget is as follow: class JournalList extends StatelessWidget {   @override   Widget build(BuildContext context) {     return Container( );   }  }  State Full Widget: State full widgets is used when Values have to change means it change the State when the certain event is occurred or data receive.The State full widget are dynamic,    Checkbox ,  Radio ,  Slider ,  InkWell ,  Form , and  TextField  are examples of stateful widgets. Stateful widgets subclass   StatefulWidget