Created
January 8, 2025 10:12
-
-
Save Lxxyx/3b66725c7a868119716ee68338c34405 to your computer and use it in GitHub Desktop.
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 StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Chat List Demo', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
colorSchemeSeed: Colors.blue, | |
), | |
home: const ChatListPage(), | |
); | |
} | |
} | |
class ChatListPage extends StatelessWidget { | |
const ChatListPage({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: const Text('Chat List'), | |
), | |
body: GridView.count( | |
crossAxisCount: 2, // 2 columns | |
children: List.generate(10, (index) { | |
return Card( | |
child: Column( | |
mainAxisSize: MainAxisSize.min, | |
children: [ | |
Text('Person $index'), | |
Text('Introduction $index'), | |
ElevatedButton( | |
onPressed: () { | |
// link button pressed | |
}, | |
child: const Text('Link'), | |
), | |
], | |
), | |
); | |
}), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment