We need some basic widgets for creating our first flutter app. Widgets describe what their view should look like given their current configuration and state. When a widget’s state changes, the widget rebuilds its description. Here we dicuss some basic widgets for creating the flutter application.

1. Text Class Widget : –

Text class is like a label in android and iOS. For use this we need to create text class object and assign the propertis and text into them. The Text widget displays a string of text with single style. The string might break across multiple lines or might all be displayed on the same line depending on the layout constraints.

class ListViewPractice extends StatelessWidget {
  Widget build(BuildContext context) {
    return new Container(
      child: new Text( "data1 one", textAlign:  TextAlign.end, 
      textDirection: TextDirection.rtl,
      textScaleFactor: 2.0,
      overflow: TextOverflow. clip,
      style: new TextStyle(
         color: Colors.red[500],
         fontSize: 30.0,
         wordSpacing: 15.0,
         letterSpacing: 2.0,
         fontWeight: FontWeight.bold,
         decoration: TextDecoration.underline,
         decorationColor: Colors.green,
         decorationStyle: TextDecorationStyle.solid),
         softWrap:  true,
      )
    );
  }
}

2. IconButton class : –

An icon button is a picture printed on a Material widget that reacts to touches by filling with color (ink).

class ListViewPractice extends StatelessWidget {
   @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Center(
        child: new Container(
          width: 60.0,
          height: 60.0,
          color: Colors.red,
          child: new IconButton(
            highlightColor: Colors.blue,
            alignment: Alignment.center,
            splashColor: Colors.green,
            disabledColor: Colors.purple,
            padding: new EdgeInsets.all(0.0),
            icon: new Icon(Icons.add_a_photo), onPressed: ()=>{},),
        ),
      ),
    );
  }
}

void setState() {
  print("Button Press");
}

Download Demo From Here 

Related Post

Emailing Phrases Most useful emailing phrases There are some standard phrases that are used in business or formal letters. These are essential to give a professional ...
Dart Introduction | Dart programming language Dart Introduction Dart is a scalable language that you can use to write simple scripts or full featured apps. Whether you’re creating a mobile app, w...
Strings String can be represented as a single-dimensional character type array. Strings in C are group of characters, digits, and symbols enclosed in quotatio...
Comments in C Comments in C Comments in C language are used to provide information about lines of code. It is widely used for documenting code. There are 2 types o...
Break Statement in JAVA Break Statement in JAVA The break statement is usually used in following two scenarios: The break statement terminates the loop immediately, and...
New Features XCode 12 – IDE Supported Configurations Xcode 12 beta includes SDKs for iOS 14 iPadOS 14 tvOS 14 watchOS 7 macOS 11 The Xcode 12 beta release supports o...
Author

Write A Comment