Add text in up screen

Hello,
I am beginner in Flutter and in this forum.
I have a problem if you can help me thank you a lot…
So I would like to add a Text in a position in this script
Thank for your help

 
@override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        decoration: new BoxDecoration(
          image: new DecorationImage(
            image: new AssetImage('assets/fond.png'),
            fit: BoxFit.cover,
          ),
        ),
        child: new Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Align(
                alignment: Alignment(0.0, yG),
                child: Image.asset(
                  "assets/G.png",
                  scale: 7,
                )),
            SizedBox(width: 150),
            Align(
                alignment: Alignment(0.0, yD),
                child: Image.asset(
                  "assets/D.png",
                  scale: 9,
                )),
          ],
        ),
      ),
      floatingActionButton: new Padding(
        padding: const EdgeInsets.symmetric(horizontal: 0.0, vertical: 0.0),
        child: new Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            new Padding(
              padding: new EdgeInsets.only(
                left: 1.0,
              ),
            ),
            FloatingActionButton(
              backgroundColor: Colors.yellow,
              heroTag: null,
              onPressed: avanceGauche,
              child: Icon(
                Icons.add,
                color: Colors.black,
              ),
            ),
            new Padding(
              padding: new EdgeInsets.only(
                left: 20.0,
              ),
            ),
            FloatingActionButton(
              backgroundColor: Colors.red,
              heroTag: null,
              onPressed: raz,
              child: Icon(
                Icons.refresh,
              ),
            ),
            new Padding(
              padding: new EdgeInsets.only(
                left: 25.0,
              ),
            ),
            FloatingActionButton(
              backgroundColor: Colors.purple,
              heroTag: null,
              onPressed: avanceDroite,
              child: Icon(
                Icons.add,
              ),
            ),
          ],
        ),
      ),
    );
  }

Hello and welcome,
I formatted your snippet to make it easier to read here; you can do the same in future by putting a single line with a triple back-tick before and after the code, it will then show indentation and also apply color syntax to it.
About your question, where do you want to display the Text in your widget tree? Have you already tried adding it in some place? What problems did you find?

Hello Patrick thank you to answer me

I would like to add before to Row because I have two images then in up/center screen please

Simple solution please :wink: I am beginner

You could try to wrap your Row with a Column, that has a children property with a list of widgets, the first will be the Text you want to add, then the present Row.

As a side note, in Dart2 you can omit the new statements in front of your widgets.

Sorry I dont know how can I insert it in my script could you show me please Thank you

I could, but I would be spoiling you from learning by trials and errors. So instead I invite you to check the Column class documentation and make some experiment with your code! I’m sure you can solve it with some efforts. In case you end up with some half working solutions then you could post it here and we’ll see what we can do to fix it. :wink:

I know the doc but sorry I donw know how add a Column before Row :frowning: HELP…

Hey it looks like you want someone here to do your homeworks! :roll_eyes:
When I learned to program in 1982 there was no internet, no help forums, nothing more the Sinclair BASIC manual shipped with my beloved ZX81. I had great time spending hours just to understand how to do some simple operation. Really I don’t feel right to spoil you from that! Please at least try, read your code, see how a Row has a widget list as children, think about how a Column could have a children list containing a Text and the Row above which you want to display some text. At the end of the day, what is the purpose of your task? I guess you want to learn, don’t you?

Hello I. dont need you do my homeworks I am 65 old LOL I don’t it because I can’t go out it’s a simple hobby bye
If an other person want help me thank you

Well I really wanted to help, but it seems I had wrong assumptions…

Anyway, I didn’t mean to be rude, just wanted to offer a learning opportunity.
Here is how you can wrap a Row with a Column:

Column(
  children: <Widget>[
    Text("Hello World"),
    Row(
        children: <Widget>[
           ...
        ],
    ),
  ],
);

Hth. :slightly_smiling_face:

Thank you Patrick for your help
Juste a last question it’s possible to put a Text in Float not with row column?

You’re welcome Carl. Sorry for the previous misundertanding. If you have difficulties to implement the Column I’ll be happy to assist you better.

I’m not sure I understand what you want to achieve, but maybe you are looking for the Stack widget. It lets you overlay widgets on top of other, like a text over an image for example:

Stack(
  children: <Widget>[
    Container(
      decoration: BoxDecoration(
        image: DecorationImage(
          image: AssetImage("img/spider.png"), fit: BoxFit.cover),
    )),
    Text("Spider",
        style: TextStyle(
            fontWeight: FontWeight.bold,
            fontSize: 72,
            color: Colors.white)),
  ],
),

Thank you a lot it’s exactly like I want :wink: