Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() {
- runApp(MyApp());
- }
- class MyApp extends StatelessWidget {
- // This widget is the root of your application.
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- home: Scaffold(
- appBar: AppBar(
- title: Text("Flexible Layout"),
- ),
- body: Column(
- children: <Widget>[
- Flexible(
- child: Row(
- children: <Widget>[
- Flexible(
- flex: 1,
- child: Container(
- margin: EdgeInsets.all(5),
- color: Colors.red,
- )),
- Flexible(
- flex: 1,
- child: Container(
- margin: EdgeInsets.all(5),
- color: Colors.green,
- )),
- Flexible(
- flex: 1,
- child: Container(
- margin: EdgeInsets.all(5),
- color: Colors.purple,
- ))
- ],
- ),
- ),
- Flexible(
- flex: 2,
- child: Container(
- margin: EdgeInsets.all(5),
- color: Colors.amber,
- )),
- Flexible(
- flex: 1,
- child: Container(
- margin: EdgeInsets.all(5),
- color: Colors.blue,
- ))
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement