Compare commits
No commits in common. "d1a41b4d3be900c2c26c15b8876c4061f40235ed" and "db4af36f8bec51259e325de60b779ffd4c3cef1b" have entirely different histories.
d1a41b4d3b
...
db4af36f8b
|
|
@ -1,9 +1,10 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:lucide_icons/lucide_icons.dart';
|
import 'package:lucide_icons/lucide_icons.dart';
|
||||||
import '../../providers/sake_list_provider.dart';
|
import '../../providers/sake_list_provider.dart';
|
||||||
import '../../models/schema/item_type.dart';
|
import '../../models/schema/item_type.dart';
|
||||||
import '../../theme/app_colors.dart';
|
|
||||||
|
|
||||||
class ActivityStats extends ConsumerWidget {
|
class ActivityStats extends ConsumerWidget {
|
||||||
const ActivityStats({super.key});
|
const ActivityStats({super.key});
|
||||||
|
|
@ -11,147 +12,78 @@ class ActivityStats extends ConsumerWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final allSakeAsync = ref.watch(allSakeItemsProvider);
|
final allSakeAsync = ref.watch(allSakeItemsProvider);
|
||||||
|
|
||||||
return allSakeAsync.when(
|
return allSakeAsync.when(
|
||||||
data: (sakes) {
|
data: (sakes) {
|
||||||
final individualSakes = sakes.where((s) => s.itemType == ItemType.sake).toList();
|
// Phase D5: Exclude set products from activity statistics (sets contain multiple items)
|
||||||
|
final individualSakes = sakes.where((s) => s.itemType == ItemType.sake).toList();
|
||||||
|
|
||||||
final totalSakes = individualSakes.length;
|
final totalSakes = individualSakes.length;
|
||||||
final favoriteCount = individualSakes.where((s) => s.userData.isFavorite).length;
|
final favoriteCount = individualSakes.where((s) => s.userData.isFavorite).length;
|
||||||
|
|
||||||
final dates = individualSakes.map((s) {
|
// Recording Days
|
||||||
final d = s.metadata.createdAt;
|
final dates = individualSakes.map((s) {
|
||||||
return DateTime(d.year, d.month, d.day);
|
final d = s.metadata.createdAt;
|
||||||
}).toSet();
|
return DateTime(d.year, d.month, d.day);
|
||||||
final recordingDays = dates.length;
|
}).toSet();
|
||||||
|
final recordingDays = dates.length;
|
||||||
final appColors = Theme.of(context).extension<AppColors>()!;
|
|
||||||
|
return Container(
|
||||||
// Bento Grid: 総登録数を大カード、お気に入り・撮影日数を小カード2枚横並び
|
padding: const EdgeInsets.all(16),
|
||||||
return Column(
|
decoration: BoxDecoration(
|
||||||
children: [
|
color: Theme.of(context).cardColor,
|
||||||
// 大カード — 総登録数
|
borderRadius: BorderRadius.circular(16),
|
||||||
_BentoCard(
|
border: Border.all(
|
||||||
child: Row(
|
color: Theme.of(context).dividerColor.withValues(alpha: 0.1),
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.all(12),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: appColors.brandPrimary.withValues(alpha: 0.1),
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
child: Icon(LucideIcons.wine, size: 28, color: appColors.brandPrimary),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 16),
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'$totalSakes本',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 32,
|
|
||||||
fontWeight: FontWeight.w900,
|
|
||||||
color: appColors.brandPrimary,
|
|
||||||
height: 1.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
Text(
|
|
||||||
'総登録数',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12,
|
|
||||||
color: appColors.textSecondary,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
child: Column(
|
||||||
// 小カード2枚横並び
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Row(
|
children: [
|
||||||
children: [
|
Text(
|
||||||
Expanded(
|
'あなたの活動深度',
|
||||||
child: _BentoCard(
|
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
||||||
child: Column(
|
fontWeight: FontWeight.bold,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Icon(LucideIcons.heart, size: 20, color: appColors.brandAccent),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Text(
|
|
||||||
'$favoriteCount本',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 22,
|
|
||||||
fontWeight: FontWeight.w900,
|
|
||||||
color: appColors.textPrimary,
|
|
||||||
height: 1.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
Text(
|
|
||||||
'お気に入り',
|
|
||||||
style: TextStyle(fontSize: 11, color: appColors.textSecondary),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(height: 16),
|
||||||
Expanded(
|
Row(
|
||||||
child: _BentoCard(
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
child: Column(
|
children: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
_buildStatItem(context, '総登録数', '$totalSakes本', LucideIcons.wine),
|
||||||
children: [
|
_buildStatItem(context, 'お気に入り', '$favoriteCount本', LucideIcons.heart),
|
||||||
Icon(LucideIcons.calendar, size: 20, color: appColors.iconDefault),
|
_buildStatItem(context, '撮影日数', '$recordingDays日', LucideIcons.calendar),
|
||||||
const SizedBox(height: 8),
|
// _buildStatItem(context, '平均価格', '¥$avgPrice', LucideIcons.banknote), // Hidden per user request
|
||||||
Text(
|
],
|
||||||
'$recordingDays日',
|
),
|
||||||
style: TextStyle(
|
],
|
||||||
fontSize: 22,
|
),
|
||||||
fontWeight: FontWeight.w900,
|
);
|
||||||
color: appColors.textPrimary,
|
|
||||||
height: 1.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
Text(
|
|
||||||
'撮影日数',
|
|
||||||
style: TextStyle(fontSize: 11, color: appColors.textSecondary),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
loading: () => const SizedBox.shrink(),
|
loading: () => const SizedBox.shrink(),
|
||||||
error: (_, _) => const SizedBox.shrink(),
|
error: (_, _) => const SizedBox.shrink(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Widget _buildStatItem(BuildContext context, String label, String value, IconData icon) {
|
||||||
class _BentoCard extends StatelessWidget {
|
return Column(
|
||||||
const _BentoCard({required this.child});
|
children: [
|
||||||
final Widget child;
|
Icon(icon, size: 20, color: Colors.grey[400]),
|
||||||
|
const SizedBox(height: 8),
|
||||||
@override
|
Text(
|
||||||
Widget build(BuildContext context) {
|
value,
|
||||||
return Container(
|
style: TextStyle(
|
||||||
width: double.infinity,
|
fontSize: 14,
|
||||||
padding: const EdgeInsets.all(16),
|
fontWeight: FontWeight.w900,
|
||||||
decoration: BoxDecoration(
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
color: Theme.of(context).cardColor,
|
),
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
border: Border.all(
|
|
||||||
color: Theme.of(context).dividerColor.withValues(alpha: 0.1),
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 4),
|
||||||
child: child,
|
Text(
|
||||||
|
label,
|
||||||
|
style: TextStyle(fontSize: 10, color: Colors.grey[600]),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,22 +115,15 @@ class LevelTitleCard extends ConsumerWidget {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
|
|
||||||
// Progress Bar (animated 0 → actual value on mount)
|
// Progress Bar
|
||||||
TweenAnimationBuilder<double>(
|
ClipRRect(
|
||||||
tween: Tween<double>(begin: 0.0, end: progress),
|
borderRadius: BorderRadius.circular(4),
|
||||||
duration: const Duration(milliseconds: 900),
|
child: LinearProgressIndicator(
|
||||||
curve: Curves.easeOutCubic,
|
value: progress,
|
||||||
builder: (context, value, _) {
|
minHeight: 8,
|
||||||
return ClipRRect(
|
backgroundColor: appColors.divider,
|
||||||
borderRadius: BorderRadius.circular(4),
|
valueColor: AlwaysStoppedAnimation<Color>(appColors.brandPrimary),
|
||||||
child: LinearProgressIndicator(
|
),
|
||||||
value: value,
|
|
||||||
minHeight: 8,
|
|
||||||
backgroundColor: appColors.divider,
|
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(appColors.brandPrimary),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.21+32
|
version: 1.0.20+31
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.10.1
|
sdk: ^3.10.1
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
{
|
{
|
||||||
"date": "2026-04-06",
|
"date": "2026-04-06",
|
||||||
"name": "Ponshu Room 1.0.21 (2026-04-06)",
|
"name": "Ponshu Room 1.0.20 (2026-04-06)",
|
||||||
"version": "v1.0.21",
|
"version": "v1.0.20",
|
||||||
"apks": {
|
"apks": {
|
||||||
"eiji": {
|
"eiji": {
|
||||||
"lite": {
|
"lite": {
|
||||||
"url": "https://posimai-lab.tail72e846.ts.net/mai/ponshu-room-lite/releases/download/v1.0.21/ponshu_room_consumer_eiji.apk",
|
"url": "https://posimai-lab.tail72e846.ts.net/mai/ponshu-room-lite/releases/download/v1.0.20/ponshu_room_consumer_eiji.apk",
|
||||||
"size_mb": 89,
|
"size_mb": 89,
|
||||||
"filename": "ponshu_room_consumer_eiji.apk"
|
"filename": "ponshu_room_consumer_eiji.apk"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"maita": {
|
"maita": {
|
||||||
"lite": {
|
"lite": {
|
||||||
"url": "https://posimai-lab.tail72e846.ts.net/mai/ponshu-room-lite/releases/download/v1.0.21/ponshu_room_consumer_maita.apk",
|
"url": "https://posimai-lab.tail72e846.ts.net/mai/ponshu-room-lite/releases/download/v1.0.20/ponshu_room_consumer_maita.apk",
|
||||||
"size_mb": 89,
|
"size_mb": 89,
|
||||||
"filename": "ponshu_room_consumer_maita.apk"
|
"filename": "ponshu_room_consumer_maita.apk"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue