Delte button + create wool from modal
This commit is contained in:
parent
aa25288c3e
commit
732042255a
8 changed files with 52 additions and 29 deletions
|
|
@ -30,12 +30,9 @@ class $WolleTable extends Wolle with TableInfo<$WolleTable, WolleData> {
|
|||
type: DriftSqlType.string, requiredDuringInsert: true);
|
||||
static const VerificationMeta _colorMeta = const VerificationMeta('color');
|
||||
@override
|
||||
late final GeneratedColumn<String> color = GeneratedColumn<String>(
|
||||
late final GeneratedColumn<int> color = GeneratedColumn<int>(
|
||||
'color', aliasedName, false,
|
||||
additionalChecks:
|
||||
GeneratedColumn.checkTextLength(minTextLength: 7, maxTextLength: 7),
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: true);
|
||||
type: DriftSqlType.int, requiredDuringInsert: true);
|
||||
@override
|
||||
List<GeneratedColumn> get $columns => [id, manufacture, title, color];
|
||||
@override
|
||||
|
|
@ -87,7 +84,7 @@ class $WolleTable extends Wolle with TableInfo<$WolleTable, WolleData> {
|
|||
title: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}title'])!,
|
||||
color: attachedDatabase.typeMapping
|
||||
.read(DriftSqlType.string, data['${effectivePrefix}color'])!,
|
||||
.read(DriftSqlType.int, data['${effectivePrefix}color'])!,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +98,7 @@ class WolleData extends DataClass implements Insertable<WolleData> {
|
|||
final int id;
|
||||
final String manufacture;
|
||||
final String title;
|
||||
final String color;
|
||||
final int color;
|
||||
const WolleData(
|
||||
{required this.id,
|
||||
required this.manufacture,
|
||||
|
|
@ -113,7 +110,7 @@ class WolleData extends DataClass implements Insertable<WolleData> {
|
|||
map['id'] = Variable<int>(id);
|
||||
map['manufacture'] = Variable<String>(manufacture);
|
||||
map['title'] = Variable<String>(title);
|
||||
map['color'] = Variable<String>(color);
|
||||
map['color'] = Variable<int>(color);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +130,7 @@ class WolleData extends DataClass implements Insertable<WolleData> {
|
|||
id: serializer.fromJson<int>(json['id']),
|
||||
manufacture: serializer.fromJson<String>(json['manufacture']),
|
||||
title: serializer.fromJson<String>(json['title']),
|
||||
color: serializer.fromJson<String>(json['color']),
|
||||
color: serializer.fromJson<int>(json['color']),
|
||||
);
|
||||
}
|
||||
@override
|
||||
|
|
@ -143,12 +140,12 @@ class WolleData extends DataClass implements Insertable<WolleData> {
|
|||
'id': serializer.toJson<int>(id),
|
||||
'manufacture': serializer.toJson<String>(manufacture),
|
||||
'title': serializer.toJson<String>(title),
|
||||
'color': serializer.toJson<String>(color),
|
||||
'color': serializer.toJson<int>(color),
|
||||
};
|
||||
}
|
||||
|
||||
WolleData copyWith(
|
||||
{int? id, String? manufacture, String? title, String? color}) =>
|
||||
{int? id, String? manufacture, String? title, int? color}) =>
|
||||
WolleData(
|
||||
id: id ?? this.id,
|
||||
manufacture: manufacture ?? this.manufacture,
|
||||
|
|
@ -182,7 +179,7 @@ class WolleCompanion extends UpdateCompanion<WolleData> {
|
|||
final Value<int> id;
|
||||
final Value<String> manufacture;
|
||||
final Value<String> title;
|
||||
final Value<String> color;
|
||||
final Value<int> color;
|
||||
const WolleCompanion({
|
||||
this.id = const Value.absent(),
|
||||
this.manufacture = const Value.absent(),
|
||||
|
|
@ -193,7 +190,7 @@ class WolleCompanion extends UpdateCompanion<WolleData> {
|
|||
this.id = const Value.absent(),
|
||||
required String manufacture,
|
||||
required String title,
|
||||
required String color,
|
||||
required int color,
|
||||
}) : manufacture = Value(manufacture),
|
||||
title = Value(title),
|
||||
color = Value(color);
|
||||
|
|
@ -201,7 +198,7 @@ class WolleCompanion extends UpdateCompanion<WolleData> {
|
|||
Expression<int>? id,
|
||||
Expression<String>? manufacture,
|
||||
Expression<String>? title,
|
||||
Expression<String>? color,
|
||||
Expression<int>? color,
|
||||
}) {
|
||||
return RawValuesInsertable({
|
||||
if (id != null) 'id': id,
|
||||
|
|
@ -215,7 +212,7 @@ class WolleCompanion extends UpdateCompanion<WolleData> {
|
|||
{Value<int>? id,
|
||||
Value<String>? manufacture,
|
||||
Value<String>? title,
|
||||
Value<String>? color}) {
|
||||
Value<int>? color}) {
|
||||
return WolleCompanion(
|
||||
id: id ?? this.id,
|
||||
manufacture: manufacture ?? this.manufacture,
|
||||
|
|
@ -237,7 +234,7 @@ class WolleCompanion extends UpdateCompanion<WolleData> {
|
|||
map['title'] = Variable<String>(title.value);
|
||||
}
|
||||
if (color.present) {
|
||||
map['color'] = Variable<String>(color.value);
|
||||
map['color'] = Variable<int>(color.value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue