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

New Tools for 64-bit Support in Xcode 9.3   New Tools for 64-bit Support in Xcode 9.3 The last macOS release to support 32-bit apps without compromise is macOS High Sierra. Make sure fu...
Introduction to JVM Introduction to JVM JVM stands for Java Virtual Machine. It works as an engine that derives the Java Code. The JVM does not understand Java ty...
Drag and Drop Collection View cell in IOS 11 &... Drag and Drop Collection View cell in IOS 11 & swift 4 In this tutorial we are explain how to drag and drop collection view cell in two collectio...
C Language – Introduction Why C? There are three important aspects of any language so as C has : The way it stores data, The way it operates on this data and How th...
How to install flutter | Flutter tutorial Flutter is the google’s mobile app SDK for develop the high-quality native app for iOS and android. We can develop the app by use of DART and javascri...
Resignation Letter and Relieving Letter Resignation Letter Sample 1 Sender’s Name, Sender’s Address, Mobile Number, MailDate:ToThe Human Resource Department Company Name Company Addre...
Author

Write A Comment