Positioned Widget
import "package:flutter/material.dart";
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "Hello",
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.brown,
),
home: const FlutterApp(),
);
}
}
class FlutterApp extends StatefulWidget {
const FlutterApp({super.key});
@override
State<FlutterApp> createState() {
return FlutterState();
}
}
class FlutterState extends State<FlutterApp> {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: InkWell(
onTap: () {
Navigator.pop(context);
},
child: const Drawer(),
),
appBar: AppBar(
title: const Text(
"Flutter Positioned_Widget",
style: TextStyle(fontWeight: FontWeight.bold),
),
centerTitle: true,
backgroundColor: Colors.grey,
),
body: Container(
width: 300,
height: double.infinity,
/*height: 500,*/
color: Colors.blueGrey,
child: Stack(
children: [
Positioned(
bottom: 41,
right: 35,
child: Container(
width: 100,
height: 100,
color: Colors.amberAccent,
),
),
],
),
),
);
}
}
Comments
Post a Comment