Last active
September 15, 2025 08:19
-
-
Save chooyan-eng/23742eb4852c539ed11ff57071840950 to your computer and use it in GitHub Desktop.
First demo at Fluttercon EU 2025
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:animated_to/animated_to.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MaterialApp(home: SimpleDemo())); | |
} | |
class SimpleDemo extends StatefulWidget { | |
const SimpleDemo({super.key}); | |
@override | |
State<SimpleDemo> createState() => _SimpleDemoState(); | |
} | |
class _SimpleDemoState extends State<SimpleDemo> { | |
bool _horizontal = true; | |
@override | |
Widget build(BuildContext context) { | |
final children = | |
[ | |
'https://pbs.twimg.com/profile_images/1618172499052593152/kBjTtVob_400x400.jpg', | |
'https://docs.flutter.dev/assets/images/flutter-logo-sharing.png', | |
'https://storage.googleapis.com/cms-storage-bucket/shadow-dash.d406c736e7c4c57f5f61.png', | |
'https://avatars.githubusercontent.com/u/1609975?s=280&v=4', | |
] | |
.map( | |
(url) => AnimatedTo.spring( | |
globalKey: GlobalObjectKey(url), | |
child: Image.network( | |
url, | |
width: 100, | |
height: 100, | |
fit: BoxFit.cover, | |
), | |
), | |
) | |
.toList(); | |
return GestureDetector( | |
onTap: () { | |
setState(() => _horizontal = !_horizontal); | |
}, | |
child: Scaffold( | |
body: Center( | |
child: _horizontal | |
? Row( | |
spacing: 16, | |
mainAxisSize: MainAxisSize.min, | |
children: children, | |
) | |
: Column( | |
spacing: 16, | |
mainAxisSize: MainAxisSize.min, | |
children: children, | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment