Flutter Tutorials

Flutter app development tutorials


flutter – Row width

main.dart


import 'package:flutter/material.dart';

void main() {
  runApp(
      MaterialApp(
          theme: ThemeData(primarySwatch: Colors.blueGrey),
          home: Scaffold(
              appBar: AppBar(
                  title: const Text("Flutter - Row Width")
              ),
              body: bodyContent(),
              backgroundColor: Colors.cyan.shade50
          )
      )
  );
}

bodyContent(){
  return SizedBox(
      height: 100, width: 250,
      child: Row(
          mainAxisAlignment: MainAxisAlignment.end,
          children: [
            Container(color: Colors.cyan.shade200, width: 50),
            Container(color: Colors.cyan.shade400, width: 50),
            Container(color: Colors.cyan.shade600, width: 50),
            Container(color: Colors.cyan.shade800, width: 50)
          ]
      )
  );
}

More flutter tutorials



About Me

Flutter Developer

Design a site like this with WordPress.com
Get started