skip to Main Content
class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.lightBlue,
        scaffoldBackgroundColor: const Color(0xFFb4c8ea),
      ),
      home: const MyText(),
    );
  }
}

class MyText extends StatelessWidget {
  const MyText({super.key});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text(
          "RAYCAN",
          style: new TextStyle(
            color: const Color(0xFF69418b),
            height: -2,
            fontStyle: FontStyle.normal,
            fontWeight: FontWeight.bold,
            fontSize: 58,
            letterSpacing: 2,
            wordSpacing: 1,
            fontFamily: "LilitaOne",
          ),
        ),
      ),
    );
  }
}

I have tried many things and didn’t seem to work, maybe I should change something but I don’t know what I’m doing. How should I do it? Thank you for the help

2

Answers


  1. instead of using Text directly you can use column or row widget like this:

    return Scaffold(
      body: Center(
        child:Column(
        children:[
          Text(
          "RAYCAN",
          style: new TextStyle(
            color: const Color(0xFF69418b),
            height: -2,
            fontStyle: FontStyle.normal,
            fontWeight: FontWeight.bold,
            fontSize: 58,
            letterSpacing: 2,
            wordSpacing: 1,
            fontFamily: "LilitaOne",
          ),
        ),
         Text(
          "RAYCAN",
          style: new TextStyle(
            color: const Color(0xFF69418b),
            height: -2,
            fontStyle: FontStyle.normal,
            fontWeight: FontWeight.bold,
            fontSize: 58,
            letterSpacing: 2,
            wordSpacing: 1,
            fontFamily: "LilitaOne",
          ),
        ),
      
     ],)
      ),
    );
    

    it will display the text widget one after another in column wise and if you want to display it in the row just replace the

    Column

    with

    Row

    in above code

    Login or Signup to reply.
  2. To add multiple Text widget or any other widget we need to use widget that supports multi widget or children. Those are could be Column , Row , Listview etc.

    Checkout this documentation for more details,

    https://docs.flutter.dev/development/ui/layout

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search