You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.2 KiB
Dart
73 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ListPlaceholder extends StatelessWidget {
|
|
static const dummyChatCount = 5;
|
|
|
|
const ListPlaceholder({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final titleColor =
|
|
Theme.of(context).textTheme.bodyLarge!.color!.withAlpha(100);
|
|
final subtitleColor =
|
|
Theme.of(context).textTheme.bodyLarge!.color!.withAlpha(50);
|
|
|
|
return ListView.builder(
|
|
itemCount: dummyChatCount,
|
|
itemBuilder: (context, i) => Opacity(
|
|
opacity: (dummyChatCount - i) / dummyChatCount,
|
|
child: Material(
|
|
child: ListTile(
|
|
leading: CircleAvatar(
|
|
backgroundColor: titleColor,
|
|
child: CircularProgressIndicator(
|
|
strokeWidth: 1,
|
|
color: Theme.of(context).textTheme.bodyLarge!.color,
|
|
),
|
|
),
|
|
title: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
height: 14,
|
|
decoration: BoxDecoration(
|
|
color: titleColor,
|
|
borderRadius: BorderRadius.circular(3),
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(width: 36),
|
|
Container(
|
|
height: 14,
|
|
width: 14,
|
|
decoration: BoxDecoration(
|
|
color: subtitleColor,
|
|
borderRadius: BorderRadius.circular(14),
|
|
),
|
|
),
|
|
const SizedBox(width: 12),
|
|
Container(
|
|
height: 14,
|
|
width: 14,
|
|
decoration: BoxDecoration(
|
|
color: subtitleColor,
|
|
borderRadius: BorderRadius.circular(14),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
subtitle: Container(
|
|
decoration: BoxDecoration(
|
|
color: subtitleColor,
|
|
borderRadius: BorderRadius.circular(3),
|
|
),
|
|
height: 12,
|
|
margin: const EdgeInsets.only(right: 22),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|