setting_view_model.dart 588 B

1234567891011121314151617181920212223
  1. import 'package:cpt_profile/modules/change_mobile/change_mobile_page.dart';
  2. import 'package:cpt_profile/modules/setting/setting_state.dart';
  3. import 'package:riverpod_annotation/riverpod_annotation.dart';
  4. part 'setting_view_model.g.dart';
  5. @riverpod
  6. class SettingViewModel extends _$SettingViewModel {
  7. @override
  8. SettingState build() {
  9. return SettingState();
  10. }
  11. void changeEnableNotification(bool value) {
  12. state = state.copyWith(enbaleNofitication: value);
  13. }
  14. //去修改手机号码的页面
  15. void gotoChangeMobilePage() {
  16. ChangeMobilePage.startInstance();
  17. }
  18. }