Added basic app state with single timer

Signed-off-by: Andreas Fahrecker <AndreasFahrecker@gmail.com>
This commit is contained in:
Andreas Fahrecker 2020-10-12 10:45:37 +02:00
parent 161d39aedc
commit e004529eb8

23
lib/models/app_state.dart Normal file
View File

@ -0,0 +1,23 @@
import 'package:meta/meta.dart';
import 'package:time_progress_calculator/models/timer.dart';
@immutable
class AppState {
final Timer timer;
AppState({this.timer});
AppState copyWith({Timer timer}) {
return AppState(timer: timer ?? this.timer);
}
@override
int get hashCode => timer.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is AppState &&
runtimeType == other.runtimeType &&
timer == other.timer;
}