2026-01-13 09:33:47 +00:00
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
|
|
|
|
|
|
// UI実験設定クラス
|
|
|
|
|
class UiExperimentSettings {
|
|
|
|
|
final int gridColumns; // 2 or 3
|
|
|
|
|
final String fabAnimation; // 'rotate' or 'bounce'
|
2026-01-15 15:53:44 +00:00
|
|
|
final bool isMapColorful; // true: Region Colors, false: Posimai/Grey
|
2026-01-29 15:54:22 +00:00
|
|
|
final bool showGridText; // [New] true: Show Text, false: Image Only
|
|
|
|
|
final bool useBadgeIcons; // [New] true: Lucide Icons, false: Emojis
|
|
|
|
|
|
2026-01-13 09:33:47 +00:00
|
|
|
const UiExperimentSettings({
|
2026-01-29 15:54:22 +00:00
|
|
|
this.gridColumns = 3,
|
|
|
|
|
this.fabAnimation = 'bounce',
|
|
|
|
|
this.isMapColorful = true,
|
|
|
|
|
this.showGridText = true, // Default to showing text
|
|
|
|
|
this.useBadgeIcons = true, // Default to Icons (Modern)
|
2026-01-13 09:33:47 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
UiExperimentSettings copyWith({
|
|
|
|
|
int? gridColumns,
|
|
|
|
|
String? fabAnimation,
|
2026-01-15 15:53:44 +00:00
|
|
|
bool? isMapColorful,
|
2026-01-29 15:54:22 +00:00
|
|
|
bool? showGridText,
|
|
|
|
|
bool? useBadgeIcons,
|
2026-01-13 09:33:47 +00:00
|
|
|
}) {
|
|
|
|
|
return UiExperimentSettings(
|
|
|
|
|
gridColumns: gridColumns ?? this.gridColumns,
|
|
|
|
|
fabAnimation: fabAnimation ?? this.fabAnimation,
|
2026-01-15 15:53:44 +00:00
|
|
|
isMapColorful: isMapColorful ?? this.isMapColorful,
|
2026-01-29 15:54:22 +00:00
|
|
|
showGridText: showGridText ?? this.showGridText,
|
|
|
|
|
useBadgeIcons: useBadgeIcons ?? this.useBadgeIcons,
|
2026-01-13 09:33:47 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-13 09:36:31 +00:00
|
|
|
// Provider (Riverpod 2.0 Notifier)
|
|
|
|
|
final uiExperimentProvider = NotifierProvider<UiExperimentNotifier, UiExperimentSettings>(UiExperimentNotifier.new);
|
2026-01-13 09:33:47 +00:00
|
|
|
|
2026-01-13 09:36:31 +00:00
|
|
|
class UiExperimentNotifier extends Notifier<UiExperimentSettings> {
|
|
|
|
|
@override
|
|
|
|
|
UiExperimentSettings build() {
|
|
|
|
|
return const UiExperimentSettings();
|
|
|
|
|
}
|
2026-01-13 09:33:47 +00:00
|
|
|
|
|
|
|
|
void setGridColumns(int columns) {
|
|
|
|
|
state = state.copyWith(gridColumns: columns);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setFabAnimation(String animation) {
|
|
|
|
|
state = state.copyWith(fabAnimation: animation);
|
|
|
|
|
}
|
2026-01-15 15:53:44 +00:00
|
|
|
|
|
|
|
|
void setMapColorful(bool isColorful) {
|
|
|
|
|
state = state.copyWith(isMapColorful: isColorful);
|
|
|
|
|
}
|
2026-01-29 15:54:22 +00:00
|
|
|
|
|
|
|
|
void setShowGridText(bool show) {
|
|
|
|
|
state = state.copyWith(showGridText: show);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setUseBadgeIcons(bool useIcons) {
|
|
|
|
|
state = state.copyWith(useBadgeIcons: useIcons);
|
|
|
|
|
}
|
2026-01-13 09:33:47 +00:00
|
|
|
}
|