Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Containers
- __________________________________________________
- //symmetric
- body: Container(
- padding : EdgeInsets.symmetric(horizontal : 20.0, vertical : 10.0),
- color : Colors.grey,
- child : Text('Hello World'),
- ),
- __________________________________________________
- // all
- body: Container(
- padding : EdgeInsets.all(20.0),
- color : Colors.grey,
- child : Text('Hello World'),
- ),
- __________________________________________________
- // fromLTRB
- body: Container(
- padding : EdgeInsets.fromLTRB(10.0, 20.0, 30.0, 40.0),
- color : Colors.grey,
- child : Text('Hello World'),
- ),
- ---------------------------------
- //Entire code
- ---------------------------------
- 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: Container(
- padding : EdgeInsets.symmetric(horizontal : 20.0, vertical : 10.0),
- color : Colors.grey,
- child : Text('Hello World'),
- ),
- floatingActionButton: FloatingActionButton(
- child: Text('click me'),
- onPressed: null,
- backgroundColor: Colors.red,
- ),
- );
- }
- }
- __________________________________________________
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement