mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 03:17:00 +08:00
feat: improve terminal page ui
This commit is contained in:
44
lib/widgets/empty_message.dart
Normal file
44
lib/widgets/empty_message.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class EmptyMessage extends StatelessWidget {
|
||||
const EmptyMessage({
|
||||
super.key,
|
||||
this.title = 'No logs yet',
|
||||
this.subtitle = 'Send a request to view its details in the console.',
|
||||
this.icon,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final IconData? icon;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (icon != null) ...[
|
||||
Icon(icon, size: 36, color: theme.colorScheme.outline),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
Text(
|
||||
title,
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
subtitle,
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user