import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
bool selected = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(
width: double.infinity,
),
Center(
child: Container(
color: Colors.blue,
width: 100,
height: 100,
),
),
const SizedBox(height: 20),
const Text(
"Bu bir Başlık",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
),
const SizedBox(height: 10),
const Text("asdasdasd gfsg fsdgdfgdfg dfgfdgdfg dgfgdfgd dfgdfgdfg "),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Row(
children: [
Text("\$270",
style: TextStyle(fontSize: 25, color: Colors.red)),
SizedBox(width: 10),
Text("\$300",
style: TextStyle(
decoration: TextDecoration.lineThrough,
)),
],
),
IconButton(
onPressed: () {
setState(() {
selected = !selected;
});
},
icon: Icon(selected == false
? Icons.star_rate_outlined
: Icons.star_rate),
)
],
)
],
),
));
}
}
No comments:
Post a Comment