forked from lxm_flutter/FlutterUnit
.
This commit is contained in:
@@ -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
|
||||
);"""; //建表语句
|
||||
|
||||
|
||||
@@ -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"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user