mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-13 18:58:53 +01:00
Remove obsolete files
This commit is contained in:
parent
0521e2b5c3
commit
3c35a383c1
2 changed files with 0 additions and 89 deletions
|
@ -1,57 +0,0 @@
|
|||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:np_codegen/np_codegen.dart';
|
||||
import 'package:to_string/to_string.dart';
|
||||
|
||||
part 'progress.g.dart';
|
||||
|
||||
abstract class ProgressBlocEvent {
|
||||
const ProgressBlocEvent();
|
||||
}
|
||||
|
||||
@toString
|
||||
class ProgressBlocUpdate extends ProgressBlocEvent {
|
||||
const ProgressBlocUpdate(this.progress, [this.text]);
|
||||
|
||||
@override
|
||||
String toString() => _$toString();
|
||||
|
||||
final double progress;
|
||||
final String? text;
|
||||
}
|
||||
|
||||
@toString
|
||||
class ProgressBlocState with EquatableMixin {
|
||||
const ProgressBlocState(this.progress, this.text);
|
||||
|
||||
@override
|
||||
String toString() => _$toString();
|
||||
|
||||
@override
|
||||
List<Object?> get props => [progress, text];
|
||||
|
||||
final double progress;
|
||||
final String? text;
|
||||
}
|
||||
|
||||
/// A generic bloc to bubble progress update for some events
|
||||
@npLog
|
||||
class ProgressBloc extends Bloc<ProgressBlocEvent, ProgressBlocState> {
|
||||
ProgressBloc() : super(const ProgressBlocState(0, null)) {
|
||||
on<ProgressBlocEvent>(_onEvent);
|
||||
}
|
||||
|
||||
Future<void> _onEvent(
|
||||
ProgressBlocEvent ev, Emitter<ProgressBlocState> emit) async {
|
||||
_log.info("[_onEvent] $ev");
|
||||
if (ev is ProgressBlocUpdate) {
|
||||
await _onEventUpdate(ev, emit);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _onEventUpdate(
|
||||
ProgressBlocUpdate ev, Emitter<ProgressBlocState> emit) async {
|
||||
emit(ProgressBlocState(ev.progress, ev.text));
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'progress.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// NpLogGenerator
|
||||
// **************************************************************************
|
||||
|
||||
extension _$ProgressBlocNpLog on ProgressBloc {
|
||||
// ignore: unused_element
|
||||
Logger get _log => log;
|
||||
|
||||
static final log = Logger("bloc.progress.ProgressBloc");
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// ToStringGenerator
|
||||
// **************************************************************************
|
||||
|
||||
extension _$ProgressBlocUpdateToString on ProgressBlocUpdate {
|
||||
String _$toString() {
|
||||
// ignore: unnecessary_string_interpolations
|
||||
return "ProgressBlocUpdate {progress: ${progress.toStringAsFixed(3)}, text: $text}";
|
||||
}
|
||||
}
|
||||
|
||||
extension _$ProgressBlocStateToString on ProgressBlocState {
|
||||
String _$toString() {
|
||||
// ignore: unnecessary_string_interpolations
|
||||
return "ProgressBlocState {progress: ${progress.toStringAsFixed(3)}, text: $text}";
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue