feat:参照研听的基础工程

This commit is contained in:
jingyun
2026-06-18 15:02:28 +08:00
commit 364fc837b3
367 changed files with 16495 additions and 0 deletions
@@ -0,0 +1,43 @@
import 'package:hooks_riverpod/hooks_riverpod.dart';
import '../../../common/domain/metal_type.dart';
import '../data/profile_models.dart';
final profileSettingsControllerProvider =
StateNotifierProvider<ProfileSettingsController, ProfileSettings>(
(ref) => ProfileSettingsController(),
);
class ProfileSettingsController extends StateNotifier<ProfileSettings> {
ProfileSettingsController()
: super(
const ProfileSettings(
amountHidden: false,
recycleDiscounts: {
MetalType.gold: 0.97,
MetalType.platinum: 0.93,
MetalType.silver: 0.88,
},
purityPresets: {
'足金9999': 0.9999,
'足金999': 0.999,
'PT950': 0.95,
'999银': 0.999,
},
priceColorMode: PriceColorMode.redUpGreenDown,
mockLoggedIn: false,
),
);
void toggleAmountHidden() {
state = state.copyWith(amountHidden: !state.amountHidden);
}
void setMockLoggedIn(bool value) {
state = state.copyWith(mockLoggedIn: value);
}
void setPriceColorMode(PriceColorMode mode) {
state = state.copyWith(priceColorMode: mode);
}
}