Last active
September 28, 2022 04:11
-
-
Save bwnyasse/0f1ea0994f8e41ab76e95328a84cf060 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ConstrainedBox'), | |
| ), | |
| body: Center( | |
| child: ConstrainedBox( | |
| constraints: const BoxConstraints( | |
| minWidth: 70, | |
| minHeight: 70, | |
| maxWidth: 150, | |
| maxHeight: 150, | |
| ), | |
| child: Container( | |
| color: Colors.red, | |
| width: 1000, | |
| height: 1000, | |
| ), | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment