How To Make Justify Content flex-end, Zero Bottom on Flutter

Viewed 1550

I want to make the text widget become Flex End on Flutter.

Here My Code :

 return MaterialApp(
      title: 'Nature',
      home: Scaffold(
        appBar: AppBar(
          title: Text('John Doe'),
        ),
        body: Center(
          child: Text('Copyright © 2020'),
        ),
      ),

I want my widget Text on Bottom.

3 Answers
  1. option one : only Text() on screen
return MaterialApp(
      title: 'Nature',
      home: Scaffold(
        appBar: AppBar(
          title: Text('John Doe'),
        ),
        body: Align(
          alignment: Alignment.bottomCenter,
          child: Text('Copyright © 2020'),
        ),
      ),
    );
  1. option two : Text() at bottom and data on screen
return MaterialApp(
      title: 'Nature',
      home: Scaffold(
        appBar: AppBar(
          title: Text('John Doe'),
        ),
        body: ListView(
          shrinkWrap: true,
          children: [
            Container(
              height: MediaQuery.of(context).size.height - 50,
              // Your Screen Data Here
            ),
            Container(
              height: 50,
              child: Center(child: Text('Copyright © 2020')),
            ),
          ],
        ),
      ),
    );

Please try this...

  return MaterialApp(
  title: 'Nature',
  home: Scaffold(
    appBar: AppBar(
      title: Text('John Doe'),
    ),
    body: Stack(
      children: <Widget>[
        Align(
            alignment: Alignment.bottomCenter,
            child: Padding(
              padding: const EdgeInsets.all(8.0),
              child: Text('Copyright © 2020'),
            )),
      ],
    ),
  ),
);

I think That bottomsheet of scaffold widget is best way to write any content at bottom of screen.

Scaffold(
      bottomSheet: Container(
        child: Text("Copyright © 2020"),
      ),
      body: Container(
       ....
Related