action display, and full display, started action editor
This commit is contained in:
@ -35,7 +35,7 @@ class AppDatabase extends _$AppDatabase {
|
||||
AppDatabase() : super(_openConnection());
|
||||
|
||||
@override
|
||||
int get schemaVersion => 22;
|
||||
int get schemaVersion => 33;
|
||||
|
||||
@override
|
||||
MigrationStrategy get migration {
|
||||
@ -165,6 +165,9 @@ class ActivityActions extends Table {
|
||||
}
|
||||
|
||||
enum RepType { time, count }
|
||||
|
||||
enum ActionStatus { pending, started, paused, complete }
|
||||
|
||||
class Actions extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
TextColumn get title => text().withLength(min: 3, max: 64)();
|
||||
@ -181,6 +184,10 @@ class Actions extends Table {
|
||||
TextColumn get setWeights => text().nullable()();
|
||||
BoolColumn get isAlternating => boolean().withDefault(Variable(false))();
|
||||
TextColumn get tempo => text().withLength(min: 6, max: 36).nullable()();
|
||||
TextColumn get status =>
|
||||
textEnum<ActionStatus>().withDefault(Variable('pending'))();
|
||||
TextColumn get state => text().withDefault(Variable(
|
||||
"{\"currentSet\": 0, \"currentRep\": 0, \"currentActionType\": 0, \"currentTime\": 0, \"currentAction\": 0}"))();
|
||||
TextColumn get set => text()();
|
||||
DateTimeColumn get createdAt =>
|
||||
dateTime().withDefault(Variable(DateTime.now()))();
|
||||
|
@ -1532,6 +1532,22 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
|
||||
GeneratedColumn.checkTextLength(minTextLength: 6, maxTextLength: 36),
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: false);
|
||||
static const VerificationMeta _statusMeta = const VerificationMeta('status');
|
||||
@override
|
||||
late final GeneratedColumnWithTypeConverter<ActionStatus, String> status =
|
||||
GeneratedColumn<String>('status', aliasedName, false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: false,
|
||||
defaultValue: Variable('pending'))
|
||||
.withConverter<ActionStatus>($ActionsTable.$converterstatus);
|
||||
static const VerificationMeta _stateMeta = const VerificationMeta('state');
|
||||
@override
|
||||
late final GeneratedColumn<String> state = GeneratedColumn<String>(
|
||||
'state', aliasedName, false,
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: false,
|
||||
defaultValue: Variable(
|
||||
"{\"currentSet\": 0, \"currentRep\": 0, \"currentActionType\": 0, \"currentTime\": 0, \"currentAction\": 0}"));
|
||||
static const VerificationMeta _setMeta = const VerificationMeta('set');
|
||||
@override
|
||||
late final GeneratedColumn<String> set = GeneratedColumn<String>(
|
||||
@ -1562,6 +1578,8 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
|
||||
setWeights,
|
||||
isAlternating,
|
||||
tempo,
|
||||
status,
|
||||
state,
|
||||
set,
|
||||
createdAt
|
||||
];
|
||||
@ -1653,6 +1671,11 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
|
||||
context.handle(
|
||||
_tempoMeta, tempo.isAcceptableOrUnknown(data['tempo']!, _tempoMeta));
|
||||
}
|
||||
context.handle(_statusMeta, const VerificationResult.success());
|
||||
if (data.containsKey('state')) {
|
||||
context.handle(
|
||||
_stateMeta, state.isAcceptableOrUnknown(data['state']!, _stateMeta));
|
||||
}
|
||||
if (data.containsKey('set')) {
|
||||
context.handle(
|
||||
_setMeta, set.isAcceptableOrUnknown(data['set']!, _setMeta));
|
||||
@ -1703,6 +1726,11 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
|
||||
.read(DriftSqlType.bool, data['${effectivePrefix}is_alternating'])!,
|
||||
tempo: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}tempo']),
|
||||
status: $ActionsTable.$converterstatus.fromSql(attachedDatabase
|
||||
.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}status'])!),
|
||||
state: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}state'])!,
|
||||
set: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}set'])!,
|
||||
createdAt: attachedDatabase.typeMapping
|
||||
@ -1717,6 +1745,8 @@ class $ActionsTable extends Actions with TableInfo<$ActionsTable, Action> {
|
||||
|
||||
static JsonTypeConverter2<RepType, String, String> $converterrepType =
|
||||
const EnumNameConverter<RepType>(RepType.values);
|
||||
static JsonTypeConverter2<ActionStatus, String, String> $converterstatus =
|
||||
const EnumNameConverter<ActionStatus>(ActionStatus.values);
|
||||
}
|
||||
|
||||
class Action extends DataClass implements Insertable<Action> {
|
||||
@ -1735,6 +1765,8 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
final String? setWeights;
|
||||
final bool isAlternating;
|
||||
final String? tempo;
|
||||
final ActionStatus status;
|
||||
final String state;
|
||||
final String set;
|
||||
final DateTime createdAt;
|
||||
const Action(
|
||||
@ -1753,6 +1785,8 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
this.setWeights,
|
||||
required this.isAlternating,
|
||||
this.tempo,
|
||||
required this.status,
|
||||
required this.state,
|
||||
required this.set,
|
||||
required this.createdAt});
|
||||
@override
|
||||
@ -1792,6 +1826,11 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
if (!nullToAbsent || tempo != null) {
|
||||
map['tempo'] = Variable<String>(tempo);
|
||||
}
|
||||
{
|
||||
map['status'] =
|
||||
Variable<String>($ActionsTable.$converterstatus.toSql(status));
|
||||
}
|
||||
map['state'] = Variable<String>(state);
|
||||
map['set'] = Variable<String>(set);
|
||||
map['created_at'] = Variable<DateTime>(createdAt);
|
||||
return map;
|
||||
@ -1829,6 +1868,8 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
isAlternating: Value(isAlternating),
|
||||
tempo:
|
||||
tempo == null && nullToAbsent ? const Value.absent() : Value(tempo),
|
||||
status: Value(status),
|
||||
state: Value(state),
|
||||
set: Value(set),
|
||||
createdAt: Value(createdAt),
|
||||
);
|
||||
@ -1854,6 +1895,9 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
setWeights: serializer.fromJson<String?>(json['setWeights']),
|
||||
isAlternating: serializer.fromJson<bool>(json['isAlternating']),
|
||||
tempo: serializer.fromJson<String?>(json['tempo']),
|
||||
status: $ActionsTable.$converterstatus
|
||||
.fromJson(serializer.fromJson<String>(json['status'])),
|
||||
state: serializer.fromJson<String>(json['state']),
|
||||
set: serializer.fromJson<String>(json['set']),
|
||||
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
||||
);
|
||||
@ -1878,6 +1922,9 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
'setWeights': serializer.toJson<String?>(setWeights),
|
||||
'isAlternating': serializer.toJson<bool>(isAlternating),
|
||||
'tempo': serializer.toJson<String?>(tempo),
|
||||
'status': serializer
|
||||
.toJson<String>($ActionsTable.$converterstatus.toJson(status)),
|
||||
'state': serializer.toJson<String>(state),
|
||||
'set': serializer.toJson<String>(set),
|
||||
'createdAt': serializer.toJson<DateTime>(createdAt),
|
||||
};
|
||||
@ -1899,6 +1946,8 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
Value<String?> setWeights = const Value.absent(),
|
||||
bool? isAlternating,
|
||||
Value<String?> tempo = const Value.absent(),
|
||||
ActionStatus? status,
|
||||
String? state,
|
||||
String? set,
|
||||
DateTime? createdAt}) =>
|
||||
Action(
|
||||
@ -1923,6 +1972,8 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
setWeights: setWeights.present ? setWeights.value : this.setWeights,
|
||||
isAlternating: isAlternating ?? this.isAlternating,
|
||||
tempo: tempo.present ? tempo.value : this.tempo,
|
||||
status: status ?? this.status,
|
||||
state: state ?? this.state,
|
||||
set: set ?? this.set,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
);
|
||||
@ -1956,6 +2007,8 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
? data.isAlternating.value
|
||||
: this.isAlternating,
|
||||
tempo: data.tempo.present ? data.tempo.value : this.tempo,
|
||||
status: data.status.present ? data.status.value : this.status,
|
||||
state: data.state.present ? data.state.value : this.state,
|
||||
set: data.set.present ? data.set.value : this.set,
|
||||
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
||||
);
|
||||
@ -1979,6 +2032,8 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
..write('setWeights: $setWeights, ')
|
||||
..write('isAlternating: $isAlternating, ')
|
||||
..write('tempo: $tempo, ')
|
||||
..write('status: $status, ')
|
||||
..write('state: $state, ')
|
||||
..write('set: $set, ')
|
||||
..write('createdAt: $createdAt')
|
||||
..write(')'))
|
||||
@ -2002,6 +2057,8 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
setWeights,
|
||||
isAlternating,
|
||||
tempo,
|
||||
status,
|
||||
state,
|
||||
set,
|
||||
createdAt);
|
||||
@override
|
||||
@ -2023,6 +2080,8 @@ class Action extends DataClass implements Insertable<Action> {
|
||||
other.setWeights == this.setWeights &&
|
||||
other.isAlternating == this.isAlternating &&
|
||||
other.tempo == this.tempo &&
|
||||
other.status == this.status &&
|
||||
other.state == this.state &&
|
||||
other.set == this.set &&
|
||||
other.createdAt == this.createdAt);
|
||||
}
|
||||
@ -2043,6 +2102,8 @@ class ActionsCompanion extends UpdateCompanion<Action> {
|
||||
final Value<String?> setWeights;
|
||||
final Value<bool> isAlternating;
|
||||
final Value<String?> tempo;
|
||||
final Value<ActionStatus> status;
|
||||
final Value<String> state;
|
||||
final Value<String> set;
|
||||
final Value<DateTime> createdAt;
|
||||
const ActionsCompanion({
|
||||
@ -2061,6 +2122,8 @@ class ActionsCompanion extends UpdateCompanion<Action> {
|
||||
this.setWeights = const Value.absent(),
|
||||
this.isAlternating = const Value.absent(),
|
||||
this.tempo = const Value.absent(),
|
||||
this.status = const Value.absent(),
|
||||
this.state = const Value.absent(),
|
||||
this.set = const Value.absent(),
|
||||
this.createdAt = const Value.absent(),
|
||||
});
|
||||
@ -2080,6 +2143,8 @@ class ActionsCompanion extends UpdateCompanion<Action> {
|
||||
this.setWeights = const Value.absent(),
|
||||
this.isAlternating = const Value.absent(),
|
||||
this.tempo = const Value.absent(),
|
||||
this.status = const Value.absent(),
|
||||
this.state = const Value.absent(),
|
||||
required String set,
|
||||
this.createdAt = const Value.absent(),
|
||||
}) : title = Value(title),
|
||||
@ -2104,6 +2169,8 @@ class ActionsCompanion extends UpdateCompanion<Action> {
|
||||
Expression<String>? setWeights,
|
||||
Expression<bool>? isAlternating,
|
||||
Expression<String>? tempo,
|
||||
Expression<String>? status,
|
||||
Expression<String>? state,
|
||||
Expression<String>? set,
|
||||
Expression<DateTime>? createdAt,
|
||||
}) {
|
||||
@ -2123,6 +2190,8 @@ class ActionsCompanion extends UpdateCompanion<Action> {
|
||||
if (setWeights != null) 'set_weights': setWeights,
|
||||
if (isAlternating != null) 'is_alternating': isAlternating,
|
||||
if (tempo != null) 'tempo': tempo,
|
||||
if (status != null) 'status': status,
|
||||
if (state != null) 'state': state,
|
||||
if (set != null) 'set': set,
|
||||
if (createdAt != null) 'created_at': createdAt,
|
||||
});
|
||||
@ -2144,6 +2213,8 @@ class ActionsCompanion extends UpdateCompanion<Action> {
|
||||
Value<String?>? setWeights,
|
||||
Value<bool>? isAlternating,
|
||||
Value<String?>? tempo,
|
||||
Value<ActionStatus>? status,
|
||||
Value<String>? state,
|
||||
Value<String>? set,
|
||||
Value<DateTime>? createdAt}) {
|
||||
return ActionsCompanion(
|
||||
@ -2162,6 +2233,8 @@ class ActionsCompanion extends UpdateCompanion<Action> {
|
||||
setWeights: setWeights ?? this.setWeights,
|
||||
isAlternating: isAlternating ?? this.isAlternating,
|
||||
tempo: tempo ?? this.tempo,
|
||||
status: status ?? this.status,
|
||||
state: state ?? this.state,
|
||||
set: set ?? this.set,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
);
|
||||
@ -2216,6 +2289,13 @@ class ActionsCompanion extends UpdateCompanion<Action> {
|
||||
if (tempo.present) {
|
||||
map['tempo'] = Variable<String>(tempo.value);
|
||||
}
|
||||
if (status.present) {
|
||||
map['status'] =
|
||||
Variable<String>($ActionsTable.$converterstatus.toSql(status.value));
|
||||
}
|
||||
if (state.present) {
|
||||
map['state'] = Variable<String>(state.value);
|
||||
}
|
||||
if (set.present) {
|
||||
map['set'] = Variable<String>(set.value);
|
||||
}
|
||||
@ -2243,6 +2323,8 @@ class ActionsCompanion extends UpdateCompanion<Action> {
|
||||
..write('setWeights: $setWeights, ')
|
||||
..write('isAlternating: $isAlternating, ')
|
||||
..write('tempo: $tempo, ')
|
||||
..write('status: $status, ')
|
||||
..write('state: $state, ')
|
||||
..write('set: $set, ')
|
||||
..write('createdAt: $createdAt')
|
||||
..write(')'))
|
||||
@ -4412,6 +4494,8 @@ typedef $$ActionsTableCreateCompanionBuilder = ActionsCompanion Function({
|
||||
Value<String?> setWeights,
|
||||
Value<bool> isAlternating,
|
||||
Value<String?> tempo,
|
||||
Value<ActionStatus> status,
|
||||
Value<String> state,
|
||||
required String set,
|
||||
Value<DateTime> createdAt,
|
||||
});
|
||||
@ -4431,6 +4515,8 @@ typedef $$ActionsTableUpdateCompanionBuilder = ActionsCompanion Function({
|
||||
Value<String?> setWeights,
|
||||
Value<bool> isAlternating,
|
||||
Value<String?> tempo,
|
||||
Value<ActionStatus> status,
|
||||
Value<String> state,
|
||||
Value<String> set,
|
||||
Value<DateTime> createdAt,
|
||||
});
|
||||
@ -4516,6 +4602,14 @@ class $$ActionsTableFilterComposer
|
||||
ColumnFilters<String> get tempo => $composableBuilder(
|
||||
column: $table.tempo, builder: (column) => ColumnFilters(column));
|
||||
|
||||
ColumnWithTypeConverterFilters<ActionStatus, ActionStatus, String>
|
||||
get status => $composableBuilder(
|
||||
column: $table.status,
|
||||
builder: (column) => ColumnWithTypeConverterFilters(column));
|
||||
|
||||
ColumnFilters<String> get state => $composableBuilder(
|
||||
column: $table.state, builder: (column) => ColumnFilters(column));
|
||||
|
||||
ColumnFilters<String> get set => $composableBuilder(
|
||||
column: $table.set, builder: (column) => ColumnFilters(column));
|
||||
|
||||
@ -4603,6 +4697,12 @@ class $$ActionsTableOrderingComposer
|
||||
ColumnOrderings<String> get tempo => $composableBuilder(
|
||||
column: $table.tempo, builder: (column) => ColumnOrderings(column));
|
||||
|
||||
ColumnOrderings<String> get status => $composableBuilder(
|
||||
column: $table.status, builder: (column) => ColumnOrderings(column));
|
||||
|
||||
ColumnOrderings<String> get state => $composableBuilder(
|
||||
column: $table.state, builder: (column) => ColumnOrderings(column));
|
||||
|
||||
ColumnOrderings<String> get set => $composableBuilder(
|
||||
column: $table.set, builder: (column) => ColumnOrderings(column));
|
||||
|
||||
@ -4664,6 +4764,12 @@ class $$ActionsTableAnnotationComposer
|
||||
GeneratedColumn<String> get tempo =>
|
||||
$composableBuilder(column: $table.tempo, builder: (column) => column);
|
||||
|
||||
GeneratedColumnWithTypeConverter<ActionStatus, String> get status =>
|
||||
$composableBuilder(column: $table.status, builder: (column) => column);
|
||||
|
||||
GeneratedColumn<String> get state =>
|
||||
$composableBuilder(column: $table.state, builder: (column) => column);
|
||||
|
||||
GeneratedColumn<String> get set =>
|
||||
$composableBuilder(column: $table.set, builder: (column) => column);
|
||||
|
||||
@ -4730,6 +4836,8 @@ class $$ActionsTableTableManager extends RootTableManager<
|
||||
Value<String?> setWeights = const Value.absent(),
|
||||
Value<bool> isAlternating = const Value.absent(),
|
||||
Value<String?> tempo = const Value.absent(),
|
||||
Value<ActionStatus> status = const Value.absent(),
|
||||
Value<String> state = const Value.absent(),
|
||||
Value<String> set = const Value.absent(),
|
||||
Value<DateTime> createdAt = const Value.absent(),
|
||||
}) =>
|
||||
@ -4749,6 +4857,8 @@ class $$ActionsTableTableManager extends RootTableManager<
|
||||
setWeights: setWeights,
|
||||
isAlternating: isAlternating,
|
||||
tempo: tempo,
|
||||
status: status,
|
||||
state: state,
|
||||
set: set,
|
||||
createdAt: createdAt,
|
||||
),
|
||||
@ -4768,6 +4878,8 @@ class $$ActionsTableTableManager extends RootTableManager<
|
||||
Value<String?> setWeights = const Value.absent(),
|
||||
Value<bool> isAlternating = const Value.absent(),
|
||||
Value<String?> tempo = const Value.absent(),
|
||||
Value<ActionStatus> status = const Value.absent(),
|
||||
Value<String> state = const Value.absent(),
|
||||
required String set,
|
||||
Value<DateTime> createdAt = const Value.absent(),
|
||||
}) =>
|
||||
@ -4787,6 +4899,8 @@ class $$ActionsTableTableManager extends RootTableManager<
|
||||
setWeights: setWeights,
|
||||
isAlternating: isAlternating,
|
||||
tempo: tempo,
|
||||
status: status,
|
||||
state: state,
|
||||
set: set,
|
||||
createdAt: createdAt,
|
||||
),
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -183,7 +183,7 @@ Future<void> seedDb(AppDatabase database) async {
|
||||
description:
|
||||
'$k Beta pully beta beta pinch one arm crimpy. Futuristic pinch, dyno dynamic drop knee climb. Climbing ondra slopey onsight beta ondra power endurance.',
|
||||
totalSets: 5,
|
||||
totalReps: "[5]",
|
||||
totalReps: "[1]",
|
||||
restBeforeSets: Value(30000),
|
||||
restBetweenSets: Value(300000),
|
||||
restBetweenReps: Value(15000),
|
||||
|
Reference in New Issue
Block a user