Last active
November 12, 2025 23:25
-
-
Save chooyan-eng/a88376bd96e32c20af9bc9b24fb7050c to your computer and use it in GitHub Desktop.
FlutterKaigi demo
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
| 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