Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1) children
- // 2) MainAxisAlignment
- // 3) CrossAxisAlignment
- import 'package:flutter/material.dart';
- void main() => runApp(MaterialApp(
- home: Home(),
- ));
- class Home extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text(
- 'App bar',
- style: TextStyle(color: Colors.white),
- ),
- centerTitle: true,
- backgroundColor: Colors.red,
- ),
- body: Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Text('Hello world'),
- TextButton(
- onPressed: () {},
- style: TextButton.styleFrom(
- primary: Colors.white,
- backgroundColor: Colors.amber,
- ),
- child: Text('Click me'),
- ),
- Container(
- color: Colors.cyan,
- padding: EdgeInsets.all(30.0),
- child: Text('Inside container')),
- ],
- ),
- floatingActionButton: FloatingActionButton(
- child: Text('click me'),
- onPressed: null,
- backgroundColor: Colors.red,
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement