Skip to content

Instantly share code, notes, and snippets.

@michaelee
Created September 14, 2023 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelee/3d9f3987f728a72bc9bb9e4a175f0825 to your computer and use it in GitHub Desktop.
Save michaelee/3d9f3987f728a72bc9bb9e4a175f0825 to your computer and use it in GitHub Desktop.
ensorcelled-sparkle-0927

ensorcelled-sparkle-0927

Created with <3 with dartpad.dev.

import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: darkBlue,
),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListView(
children: [
...
List.generate(10, (index) {
return ListTile(
title: Text('$index'),
);
}),
GridView.count(
crossAxisCount: 3,
shrinkWrap: true,
children: List.generate(30, (index) {
return Center(
child: Text(
'Item $index',
style: Theme.of(context).textTheme.headlineSmall,
),
);
}),
),
...
List.generate(10, (index) {
return ListTile(
title: Text('${10 + index}'),
);
}),
]
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment