Polish 20201102 203549205
November 2, 2020

Flutter Lesson -2 | Using Text Widgets

By Zexon-dev

Today we will address flutter text widget. As I mentioned earlier, Flutter gives us an easy use thanks to widgets.We will examine what belongs to the Text Widget from these features.

See: Flutter Lesson 1 – What is the Concept of Flutter Widgets?


Flutter Text Widget Usage:

Now, before we start my samples, we need to understand some logic.

When creating a mobile app with Flutter, there is sometimes a need to use text or words in certain places. In these cases, we use the Text Widget that Flutter offers us.

I first created a new project to use, and with an add-on I used on Flutter, I completed the Main App and the required locations, and then I put the Center Widget in Scaffold, and i put the Text Widget in it. Yes, it may be a little complicated, but in other classes, it’s going to get better when you think about what these are.

Flutter Text Widget Example

Flutter Text Widget Example

Here I printed the widget directly from my ancestor of some features and it occurred directly in the middle of the ekrna. Of course, there are some features that don’t just happen.

The code example is in the right.


import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Material App',
        home: Scaffold(
            body: Center(
                child: Text(
          "insolitax.net",
        ))));
  }
}

Widget Features:

Of course, not only does he write, but he has a few other things in the same xamanda.

Flutter Text Widget

Flutter Text Widget

As you can see, we have identified many speciality such as Text color, size, inter-letters clarity, and now let me look at the code in the following and explain their logic.


import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Material App',
        home: Scaffold(
            body: Center(
          child: Text(
            "insolitax.net",
            style: TextStyle(
              color: Colors.amber,
              fontSize: 50,
              decoration: TextDecoration.overline,
              letterSpacing: 10,
            ),
          ),
        )));
  }
}

decoration:
TextDecoration.overlin
e
The over-type line.

decoration: TextDecoration.lineThrough
It's
the line that crosses the writing.

decoration:
TextDecoration.combine(decorations)
The
section in which the found properties are assigned in bulk. Returns a list.

letterSpacing: 10
Leaves a space of 10 pixels between letters.

color: Colors.amber
Determines the font color .amber is instead assigned the desired color. Color also has different use.


Detailed Information: Flutter Google