flutter text widget example

Total
0
Shares
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const TextWidget(),
    );
  }
}

class TextWidget extends StatelessWidget {
  const TextWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Text Widget'),
      ),
      body: Container(
        child: Text(
          'Hi, How Are you?',
          style: TextStyle(
            fontSize: 40,
            color: Colors.red,
            fontWeight: FontWeight.bold,
            fontStyle: FontStyle.italic,
            letterSpacing: 3,
            wordSpacing: 10,
            backgroundColor: Colors.amber,
          ),
        ),
      ),
    );
  }
}

Enter fullscreen mode

Exit fullscreen mode

Total
0
Shares
Valentsea

Better DX in Vue apps with Vite Devtools

Good Developer Experience (DX) is crucial for the Open Source product to be widely used. There are so…

You May Also Like