forked from md-siam/widget_of_the_day
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpositioned.dart
47 lines (45 loc) · 1.37 KB
/
positioned.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
import 'package:flutter/material.dart';
class MyPositioned extends StatelessWidget {
const MyPositioned({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Positioned')),
body: Center(
child: Container(
height: 450,
width: 300,
color: Colors.transparent,
child: Stack(
alignment: Alignment.topRight,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(10.0),
child: Container(
alignment: Alignment.center,
height: 200,
width: 200,
color: Colors.deepPurple[300],
child: const Text(
"What was I thinking.?",
style: TextStyle(color: Colors.white, fontSize: 18),
),
),
),
Positioned(
bottom: 0, // zero distance from the bottom
left: 0, // zero distance from the right
width: 200,
height: 300,
child: SizedBox(
height: 200,
child: Image.asset('assets/images/pngegg.png'),
),
),
],
),
),
),
);
}
}