This commit is contained in:
toly
2020-04-07 06:30:39 +08:00
parent 1440eef185
commit dd52bc7157
124 changed files with 6217 additions and 1360 deletions

View File

@@ -23,6 +23,7 @@ class FlutterDb {
family INTEGER NOT NULL,
lever FLOAT(2) NOT NULL,
image VARCHAR(128) NOT NULL,
linkWidget TEXT DEFAULT '',
info VARCHAR(256) NOT NULL
);"""; //建表语句

View File

@@ -12,6 +12,7 @@ class WidgetPo extends Equatable {
final double lever;
final String image;
final String info;
final String linkWidget;
const WidgetPo(
{this.id,
@@ -20,6 +21,7 @@ class WidgetPo extends Equatable {
this.childCount,
this.family,
this.lever,
this.linkWidget,
this.image,
this.info});
@@ -30,8 +32,9 @@ class WidgetPo extends Equatable {
nameCN: map["nameCN"],
family: map["family"],
childCount: map["childCount"],
lever: map["lever"],
lever: map["lever"].toDouble(),
image: map["image"],
linkWidget: map["linkWidget"],
info: map["info"]);
}

View File

@@ -9,8 +9,8 @@ class WidgetDao {
final db = await FlutterDb.db.database;
String addSql = //插入数据
"INSERT INTO "
"widget(id,name,nameCN,childCount,family,lever,image,info) "
"VALUES (?,?,?,?,?,?,?,?);";
"widget(id,name,nameCN,childCount,family,lever,image,linkWidget,info) "
"VALUES (?,?,?,?,?,?,?,?,?);";
return await db.transaction((tran) async => await tran.rawInsert(addSql, [
widget.id,
widget.name,
@@ -19,6 +19,7 @@ class WidgetDao {
widget.family,
widget.lever,
widget.image,
widget.linkWidget,
widget.info
]));
}