Skip to content

Instantly share code, notes, and snippets.

@chooyan-eng
Last active November 12, 2025 23:25
Show Gist options
  • Select an option

  • Save chooyan-eng/a88376bd96e32c20af9bc9b24fb7050c to your computer and use it in GitHub Desktop.

Select an option

Save chooyan-eng/a88376bd96e32c20af9bc9b24fb7050c to your computer and use it in GitHub Desktop.
FlutterKaigi demo
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool _isTop = true;
final _title = 'RenderObject とは何か?\nanimated_to に学ぶレイアウト計算と描画の仕組み';
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() => _isTop = !_isTop);
},
child: Container(
width: double.infinity,
height: double.infinity,
padding: const EdgeInsets.all(20),
child: Align(
alignment: _isTop ? Alignment.topCenter : Alignment.bottomCenter,
child: Text(
_title,
style: TextStyle(fontSize: 18),
textAlign: TextAlign.center,
),
),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment