我的界面 修改昵称完成
This commit is contained in:
22
lib/features/my/presentation/bloc/my_state.dart
Normal file
22
lib/features/my/presentation/bloc/my_state.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:maibu_satabot_v2/features/devices/domain/entities/device_entity.dart';
|
||||
|
||||
class MyState extends Equatable {
|
||||
final bool isLoading; // 是否正在加载
|
||||
final String? errorMessage; // 错误信息
|
||||
final String? nickName;
|
||||
|
||||
const MyState({this.isLoading = false, this.errorMessage, this.nickName});
|
||||
|
||||
// 使用 copyWith 方便局部更新状态
|
||||
MyState copyWith({bool? isLoading, String? errorMessage, String? nickName}) {
|
||||
return MyState(
|
||||
isLoading: isLoading ?? this.isLoading,
|
||||
errorMessage: errorMessage, // 错误信息通常每次更新都要重新赋值或清空
|
||||
nickName: nickName,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [isLoading, errorMessage, nickName];
|
||||
}
|
||||
Reference in New Issue
Block a user