Created with <3 with dartpad.dev.
Created
September 14, 2023 16:55
-
-
Save michaelee/3d9f3987f728a72bc9bb9e4a175f0825 to your computer and use it in GitHub Desktop.
ensorcelled-sparkle-0927
This file contains 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'; | |
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