Last active
September 28, 2022 04:14
-
-
Save bwnyasse/8fc5ea7843f87cf8c022b05250a3106b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Dart & Flutter - Training | |
* | |
* Copyright (c) Boris-Wilfried Nyasse | |
* All rights reserved | |
*/ | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Formation Dart & Flutter', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: MyHomePage(), | |
); | |
} | |
} | |
class MyHomePage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: const Text('Comprendre le FittedBox'), | |
), | |
body: Center( | |
child: Container( | |
color: Colors.black26, | |
width: 200.0, | |
height: 200.0, | |
child: FittedBox( | |
fit: BoxFit.none, | |
child: Container( | |
color: Colors.teal, | |
width: 100.0, | |
height: 50.0, | |
child: const Center( | |
child: Text( | |
'Formation Dart & Flutter', | |
textAlign: TextAlign.center, | |
style: TextStyle( | |
color: Colors.white, | |
), | |
), | |
), | |
), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment