Flutter Tutorials

Flutter app development tutorials


flutter – Container content alignment

main.dart


import 'package:flutter/material.dart';

void main(){
  runApp(
    MaterialApp(
      home: Scaffold(
        appBar: AppBar(
            title: const Text("Flutter - Container Alignment")
        ),
        body: Center(
          child: Container(
            width: 300, height: 150, color: Colors.pink.shade200,
            alignment: Alignment.topRight,
            child: const Icon(Icons.add_chart),
            padding: const EdgeInsets.all(8),
          ),
        ),
      ),
    )
  );
}

More flutter tutorials



About Me

Flutter Developer

Design a site like this with WordPress.com
Get started