Skip to content

Instantly share code, notes, and snippets.

@JohanScheepers
Created July 18, 2025 20:02
Show Gist options
  • Select an option

  • Save JohanScheepers/d1d2b216403aed5e8948cde47bae53ec to your computer and use it in GitHub Desktop.

Select an option

Save JohanScheepers/d1d2b216403aed5e8948cde47bae53ec to your computer and use it in GitHub Desktop.
ConfusionApp
// 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