projet debut

This commit is contained in:
felix-vi
2025-10-14 12:29:11 +02:00
parent c642a6f914
commit 5d1d2f4498
16 changed files with 256 additions and 20 deletions

View File

@@ -1,12 +1,31 @@
import 'package:flutter/material.dart';
void main() {
runApp(
Container(
color: Colors.red,
alignment: Alignment.center,
margin: const EdgeInsets.all(100),
child: const Text("Hello world", textDirection: TextDirection.ltr),
),
);
class CardWithImage extends StatelessWidget {
const CardWithImage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Card + Image de fond')),
body: Padding(
padding: const EdgeInsets.all(10),
child: Card(
elevation: 5,
clipBehavior: Clip.antiAlias,
child: SizedBox(
height: 150,
child: Stack(
fit: StackFit.expand, // l'enfant occupe toute la carte
children: [
// Image locale déclarée dans pubspec.yaml
Image.asset(
'assets/images/paris.jpg',
fit: BoxFit.cover, // couvre toute la surface, quitte à rogner
),
],
),
),
),
),
);
}
}