import 'package:freezed_annotation/freezed_annotation.dart'; import 'loading_error.dart'; part 'loadable_state.freezed.dart'; @freezed abstract class LoadableState with _$LoadableState { const LoadableState._(); const factory LoadableState({ required bool isLoading, required TState? data, required int? lastFetch, required void Function()? reFetch, required LoadingError? error, // Transient progress note under the primary loading spinner (e.g. retry // progress). Lives only within one fetch cycle — never persisted. String? statusText, }) = _LoadableState; bool showContent() => data != null; }