import 'package:flutter_riverpod/flutter_riverpod.dart';

// UI実験設定クラス
class UiExperimentSettings {
  final int gridColumns;        // 2 or 3
  final String fabAnimation;    // 'rotate' or 'bounce'
  
  const UiExperimentSettings({
    this.gridColumns = 2,
    this.fabAnimation = 'rotate',
  });
  
  UiExperimentSettings copyWith({
    int? gridColumns,
    String? fabAnimation,
  }) {
    return UiExperimentSettings(
      gridColumns: gridColumns ?? this.gridColumns,
      fabAnimation: fabAnimation ?? this.fabAnimation,
    );
  }
}

// Provider (Riverpod 2.0 Notifier)
final uiExperimentProvider = NotifierProvider<UiExperimentNotifier, UiExperimentSettings>(UiExperimentNotifier.new);

class UiExperimentNotifier extends Notifier<UiExperimentSettings> {
  @override
  UiExperimentSettings build() {
    return const UiExperimentSettings();
  }
  
  void setGridColumns(int columns) {
    state = state.copyWith(gridColumns: columns);
  }
  
  void setFabAnimation(String animation) {
    state = state.copyWith(fabAnimation: animation);
  }
}
