Created
July 18, 2025 20:02
-
-
Save JohanScheepers/d1d2b216403aed5e8948cde47bae53ec to your computer and use it in GitHub Desktop.
ConfusionApp
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
| // Copyright 2022 Me. All rights reserved. | |
| // ConfusionApp | |
| // Intensionally cause confusion between width and height | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(const ConfusionApp()); | |
| } | |
| class ConfusionApp extends StatelessWidget { | |
| const ConfusionApp({super.key}); | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'Confucius App', | |
| theme: ThemeData( | |
| colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), | |
| useMaterial3: true, | |
| ), | |
| home: const SystemInfoPage(), | |
| ); | |
| } | |
| } | |
| class SystemInfoPage extends StatelessWidget { | |
| const SystemInfoPage({super.key}); | |
| @override | |
| Widget build(BuildContext context) { | |
| final size = MediaQuery.sizeOf(context); | |
| // This widget intentionally uses width and height in a confusing way. | |
| return Scaffold( | |
| appBar: AppBar( | |
| title: const Text('Confucius App'), | |
| centerTitle: true, | |
| backgroundColor: Theme.of(context).colorScheme.inversePrimary, | |
| ), | |
| body: Center( | |
| child: SizedBox( | |
| width: size.height, | |
| height: size.width, | |
| child: Text('Size Confusion Widget'), | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment