Skip to content

Instantly share code, notes, and snippets.

@Lxxyx
Created February 22, 2025 14:07
Show Gist options
  • Save Lxxyx/59d82bd8affca3d39bb314bad3da7312 to your computer and use it in GitHub Desktop.
Save Lxxyx/59d82bd8affca3d39bb314bad3da7312 to your computer and use it in GitHub Desktop.
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: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorSchemeSeed: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
final String title;
const MyHomePage({
super.key,
required this.title,
});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: ListView.builder(
itemCount: 10, // assuming you have 10 chat items
itemBuilder: (context, index) {
return Card(
child: ListTile(
leading: CircleAvatar(
backgroundColor: Colors.grey,
radius: 25,
),
title: Text('Name $index'),
subtitle: Text('Introduction $index'),
trailing: ElevatedButton(
onPressed: () {},
child: Text('Link'),
),
),
);
},
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment