| 12345678910111213141516171819202122232425262728293031323334 |
- import 'package:flutter/material.dart';
- import 'package:tdesign_flutter/tdesign_flutter.dart';
- class EmptyState extends StatelessWidget {
- final String message;
- final String? operationText;
- final VoidCallback? onTap;
- const EmptyState({
- super.key,
- required this.message,
- this.operationText,
- this.onTap,
- });
- @override
- Widget build(BuildContext context) {
- return Center(
- child: TDEmpty(
- type: onTap != null ? TDEmptyType.operation : TDEmptyType.plain,
- emptyText: message,
- operationText: operationText,
- onTapEvent: onTap,
- image: Container(
- margin: const EdgeInsets.only(bottom: 16),
- child: const TDImage(
- width: 120,
- assetUrl: 'assets/img/ic_empty.png',
- type: TDImageType.fitWidth,
- ),
- ),
- ),
- );
- }
- }
|