Skip to content

Instantly share code, notes, and snippets.

@Lootwig
Created August 20, 2023 22:45
Show Gist options
  • Save Lootwig/9fe057209798eea5fcd1edd2c20aa816 to your computer and use it in GitHub Desktop.
Save Lootwig/9fe057209798eea5fcd1edd2c20aa816 to your computer and use it in GitHub Desktop.
xenial-rose-4702
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
// theme: ThemeData.dark(),
home: Home(),
);
}
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Material App Bar'),
),
body: AnimatedRotation(
duration: const Duration(milliseconds: 500),
turns: .25,
child: OverflowBox(
maxWidth: double.infinity,
maxHeight: double.infinity,
alignment: Alignment.center,
child: SizedBox(
width: MediaQuery.of(context).size.height,
height: MediaQuery.of(context).size.width,
child: Center(
child: Stack(
children: [
AspectRatio(
aspectRatio: 16 / 9,
child: SizedBox.expand(child: Placeholder()),
),
Positioned(
top: 32,
left: 32,
child: IconButton(
onPressed: () => print('tap'),
icon: Icon(Icons.close),
),
),
],
),
),
),
),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {},
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment