Skip to content

Instantly share code, notes, and snippets.

@bwnyasse
Last active September 28, 2022 04:11
Show Gist options
  • Select an option

  • Save bwnyasse/0f1ea0994f8e41ab76e95328a84cf060 to your computer and use it in GitHub Desktop.

Select an option

Save bwnyasse/0f1ea0994f8e41ab76e95328a84cf060 to your computer and use it in GitHub Desktop.
/*
* 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