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
- flutter – How to change AppBar height
- flutter – How to get AppBar height
- flutter – Full screen display
- flutter – Container padding and margin
- flutter – Container full width
- flutter – How to align Text
- flutter – How to change Text underline thickness
- flutter – Space between Text and underline
- flutter – How to add shadow to the Text
- flutter – How to add a border to Text
- flutter – How to add stroke to Text
- flutter – Text decoration
- flutter – Gradient Text
- flutter – Text gradient background
- flutter – How to set Text letter spacing