开始学习 UI 布局

This commit is contained in:
qwe
2026-05-26 00:01:15 +08:00
parent 94896df433
commit 97c88862ec
6 changed files with 575 additions and 5 deletions

32
lib/container.dart Normal file
View File

@@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
class ZContainer extends StatelessWidget {
const ZContainer({super.key});
@override
Widget build(BuildContext context){
return Row(
mainAxisAlignment: .spaceBetween,
children: [
SizedBox(
width: 200,
height: .infinity,
child: DefaultTextStyle(
style: TextStyle(
color: Colors.white
),
child: Column(
children: [
Text("导入数据"),
Text("查询数据")
],
)
),
),
Expanded(child: Container(
color: Colors.blue,
))
]
);
}
}

View File

@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'container.dart';
void main() {
runApp(const MyApp());
}
@@ -30,7 +32,7 @@ class MyApp extends StatelessWidget {
// tested with just a hot reload.
colorScheme: .fromSeed(seedColor: Colors.deepPurple),
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
home: ZContainer(),
);
}
}

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

@@ -0,0 +1,23 @@
import 'package:drift/drift.dart';
/// 导入记录表定义
class ImportRecord extends Table {
/// 导入记录 ID
IntColumn get id => integer().autoIncrement()();
/// 导入时间
DateTimeColumn get createTime => dateTime()();
/// 导入文件名称
TextColumn get fileName => text()();
}
/// 进销明细表
class SaleDetail extends Table {
/// 记录唯一 ID
IntColumn get id => integer().autoIncrement()();
/// 进销单据编号
TextColumn get detailNo => text()();
/// 交易对象名称
TextColumn get objName => text()();
/// 进销单据性质
/// 关联导入记录 ID
}