Skip to content

Instantly share code, notes, and snippets.

@chooyan-eng
Last active September 23, 2025 07:31
Show Gist options
  • Save chooyan-eng/23742eb4852c539ed11ff57071840950 to your computer and use it in GitHub Desktop.
Save chooyan-eng/23742eb4852c539ed11ff57071840950 to your computer and use it in GitHub Desktop.
First demo at Fluttercon EU 2025
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) => Image.network(
url,
width: 60,
height: 60,
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