143 lines
4.6 KiB
Dart
143 lines
4.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_animate/flutter_animate.dart';
|
|
import '../theme.dart';
|
|
import '../l10n/app_localizations.dart';
|
|
|
|
class AppMarketPage extends StatelessWidget {
|
|
const AppMarketPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l10n = AppLocalizations.of(context)!;
|
|
final plugins = <_Plugin>[
|
|
_Plugin(
|
|
name: '开关房',
|
|
desc: '管理房态、入住与退房',
|
|
icon: Icons.meeting_room_outlined,
|
|
color: const Color(0xFF3B82F6),
|
|
),
|
|
_Plugin(
|
|
name: '下载报表',
|
|
desc: '导出经营数据与报表文件',
|
|
icon: Icons.file_download_outlined,
|
|
color: const Color(0xFFF59E0B),
|
|
),
|
|
_Plugin(
|
|
name: '评价管理',
|
|
desc: '查看与回复客户评价',
|
|
icon: Icons.rate_review_outlined,
|
|
color: const Color(0xFFEC4899),
|
|
),
|
|
];
|
|
|
|
return Scaffold(
|
|
backgroundColor: AppColors.background,
|
|
appBar: AppBar(
|
|
title: Text(l10n.appMarket),
|
|
backgroundColor: AppColors.surface,
|
|
elevation: 0,
|
|
scrolledUnderElevation: 0,
|
|
surfaceTintColor: Colors.transparent,
|
|
),
|
|
body: ListView.builder(
|
|
padding: const EdgeInsets.fromLTRB(16, 16, 16, 24),
|
|
itemCount: plugins.length,
|
|
itemBuilder: (context, index) {
|
|
final p = plugins[index];
|
|
return Padding(
|
|
padding: const EdgeInsets.only(bottom: 12),
|
|
child: Material(
|
|
color: AppColors.surface,
|
|
borderRadius: BorderRadius.circular(16),
|
|
child: InkWell(
|
|
borderRadius: BorderRadius.circular(16),
|
|
onTap: () => _openPlugin(context, p.name),
|
|
child: Container(
|
|
padding: const EdgeInsets.all(16),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(16),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.black.withValues(alpha: 0.03),
|
|
blurRadius: 10,
|
|
offset: const Offset(0, 2),
|
|
),
|
|
],
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
width: 48,
|
|
height: 48,
|
|
decoration: BoxDecoration(
|
|
color: p.color.withValues(alpha: 0.1),
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
child: Icon(p.icon, color: p.color, size: 24),
|
|
),
|
|
const SizedBox(width: 14),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
p.name,
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w600,
|
|
color: AppColors.textPrimary,
|
|
),
|
|
),
|
|
const SizedBox(height: 4),
|
|
Text(
|
|
p.desc,
|
|
style: TextStyle(
|
|
fontSize: 13,
|
|
color: AppColors.textSecondary,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Icon(
|
|
Icons.chevron_right,
|
|
color: AppColors.textTertiary,
|
|
size: 20,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
).animate().fadeIn(duration: 300.ms, delay: (index * 60).ms).slideY(begin: 0.1, end: 0, duration: 300.ms);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
void _openPlugin(BuildContext context, String name) {
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
SnackBar(
|
|
content: Text('$name 即将上线'),
|
|
behavior: SnackBarBehavior.floating,
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
|
duration: const Duration(seconds: 2),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _Plugin {
|
|
final String name;
|
|
final String desc;
|
|
final IconData icon;
|
|
final Color color;
|
|
|
|
const _Plugin({
|
|
required this.name,
|
|
required this.desc,
|
|
required this.icon,
|
|
required this.color,
|
|
});
|
|
}
|