-
Notifications
You must be signed in to change notification settings - Fork 0
/
align_screen.dart
64 lines (46 loc) · 1.82 KB
/
align_screen.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import 'package:design_system/theme/app_typography.dart';
import 'package:design_system/component/scaffold_appbar.dart';
import 'package:flutter/material.dart';
class AlignScreen extends StatelessWidget {
const AlignScreen({super.key});
@override
Widget build(BuildContext context) {
return ScaffoldInfoActionAppBar(
title: "Align",
widgetDescription: "The alignment property describes a point in the child 's coordinate system and a different point in the coordinate system of this widget.",
//We can also use container
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Stack(
children: [
Align(
alignment: Alignment.topLeft,
child: Text("Top Left Alignment",style: AppTypography.typography.titleSmall,),
),
Align(
alignment: Alignment.topRight,
child: Text("Top Right Alignment",style: AppTypography.typography.titleSmall,),
),
Align(
alignment: Alignment.center,
child: Text("Center Alignment",style: AppTypography.typography.titleSmall,),
),
Align(
alignment: Alignment.bottomLeft,
child: Text("Bottom Left Alignment",style: AppTypography.typography.titleSmall,),
),
Align(
alignment: Alignment.bottomRight,
child: Text("Bottom Right Alignment",style: AppTypography.typography.titleSmall,),
),
//0.5 of x axis that's means x axis in center and 0.8 is y axis that means 80%
Align(
alignment: const Alignment(0.5, 0.8),
child: Text("Custom Alignment",style: AppTypography.typography.titleSmall,),
),
],
),
),
);
}
}