2025-02-03 23:32:00 +08:00
|
|
|
import 'package:flutter/widgets.dart';
|
2024-12-09 01:40:39 +08:00
|
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
|
|
|
|
|
|
part 'generated/widget.freezed.dart';
|
|
|
|
|
|
|
|
|
|
@freezed
|
|
|
|
|
class ActivateState with _$ActivateState {
|
|
|
|
|
const factory ActivateState({
|
|
|
|
|
required bool active,
|
|
|
|
|
}) = _ActivateState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@freezed
|
|
|
|
|
class CommonMessage with _$CommonMessage {
|
|
|
|
|
const factory CommonMessage({
|
|
|
|
|
required String id,
|
|
|
|
|
required String text,
|
|
|
|
|
@Default(Duration(seconds: 3)) Duration duration,
|
|
|
|
|
}) = _CommonMessage;
|
|
|
|
|
}
|
2025-02-03 23:32:00 +08:00
|
|
|
|
|
|
|
|
@freezed
|
2025-03-12 17:15:31 +08:00
|
|
|
class AppBarState with _$AppBarState {
|
|
|
|
|
const factory AppBarState({
|
2025-02-03 23:32:00 +08:00
|
|
|
@Default([]) List<Widget> actions,
|
2025-03-12 17:15:31 +08:00
|
|
|
AppBarSearchState? searchState,
|
|
|
|
|
AppBarEditState? editState,
|
|
|
|
|
}) = _AppBarState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@freezed
|
|
|
|
|
class AppBarSearchState with _$AppBarSearchState {
|
|
|
|
|
const factory AppBarSearchState({
|
|
|
|
|
required Function(String) onSearch,
|
2025-06-07 01:48:34 +08:00
|
|
|
@Default(null) String? query,
|
2025-03-12 17:15:31 +08:00
|
|
|
}) = _AppBarSearchState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@freezed
|
|
|
|
|
class AppBarEditState with _$AppBarEditState {
|
|
|
|
|
const factory AppBarEditState({
|
2025-06-07 01:48:34 +08:00
|
|
|
@Default(0) int editCount,
|
2025-03-12 17:15:31 +08:00
|
|
|
required Function() onExit,
|
|
|
|
|
}) = _AppBarEditState;
|
2025-02-03 23:32:00 +08:00
|
|
|
}
|