ZhuQingRui_Branch
朱卿睿 2 years ago
commit 5f6977d7a3

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

@ -22,6 +22,7 @@ class CollectionControl {
museumName: maps[index]['MuseumName'],
collectionName: maps[index]['CollectionName'],
collectionDetail: maps[index]['CollectionDetail'],
imagePath: maps[index]['ImagePath'],
);
});
}

@ -17,21 +17,64 @@ class MyDatabase {
}
static Future<void> _createTables(Database db, int version) async {
await _createCollectionInfoTable(db, version);
// await _createMuseumInfoTable(db, version);
// await _createCollectionInfoTable(db, version);
await _createCommunityInfoTable(db, version);
await _createServiceInfoTable(db, version);
}
static Future<void> _createMuseumInfoTable(Database db, int version) async {
await db.execute('''
CREATE TABLE IF NOT EXISTS MuseumInfo(
MuseumName TEXT PRIMARY KEY,
MuseumDetail TEXT NOT NULL,
ImagePath TEXT NOT NULL
);
''');
print("MuseumInfoTable create success");
}
static Future<void> _createCollectionInfoTable(Database db, int version) async {
await db.execute('''
CREATE TABLE IF NOT EXISTS CollectionInfo(
CollectionID BIGINT PRIMARY KEY,
MuseumName TEXT NOT NULL,
CollectionName TEXT NOT NULL,
CollectionDetail TEXT NOT NULL
);
''');
CREATE TABLE IF NOT EXISTS CollectionInfo(
CollectionID INTEGER PRIMARY KEY,
MuseumName TEXT,
CollectionName TEXT,
CollectionDetail TEXT,
ImagePath TEXT,
FOREIGN KEY (MuseumName) REFERENCES MuseumInfo(MuseumName)
);
''');
print("CollectionInfoTable create success");
}
static Future<void> _createCommunityInfoTable(Database db, int version) async {
await db.execute('''
CREATE TABLE IF NOT EXISTS CommunityInfo(
CommunityID INTEGER PRIMARY KEY,
MuseumName TEXT,
Author TEXT,
PostTime TEXT,
Comment TEXT,
FOREIGN KEY (MuseumName) REFERENCES MuseumInfo(MuseumName)
);
''');
print("CommunityInfoTable create success");
}
static Future<void> _createServiceInfoTable(Database db, int version) async {
await db.execute('''
CREATE TABLE IF NOT EXISTS ServiceInfo(
ServiceID INTEGER PRIMARY KEY,
MuseumName TEXT,
Service TEXT,
FOREIGN KEY (MuseumName) REFERENCES MuseumInfo(MuseumName)
);
''');
print("ServiceInfoTable create success");
}
static Future<void> reBuildDatabase() async {
final databasePath = await getDatabasesPath();
final path = join(databasePath, 'tma.db');
@ -40,4 +83,4 @@ class MyDatabase {
await openDatabase(path, version: 1, onCreate: _createTables);
await _createTables(database, 1);
}
}
}

@ -7,15 +7,16 @@ class CollectionInfo {
late String museumName;
late String collectionName;
late String collectionDetail;
late String imagePath;
CollectionInfo({
required this.collectionID,
required this.museumName,
required this.collectionName,
required this.collectionDetail,
required this.imagePath,
});
//
static Future<List<CollectionInfo>> getAllCollections() async {
final Database db = await MyDatabase.initDatabase();
final List<Map<String, dynamic>> maps = await db.query('CollectionInfo');
@ -26,7 +27,8 @@ class CollectionInfo {
museumName: maps[index]['MuseumName'],
collectionName: maps[index]['CollectionName'],
collectionDetail: maps[index]['CollectionDetail'],
imagePath: maps[index]['ImagePath'],
);
});
}
}
}

@ -66,7 +66,7 @@ class _MapPageState extends State<MapPage> {
Widget build(BuildContext context) { //
return Scaffold( //
appBar: AppBar( //
title: Text('地图 - ${currentFloor + 1}'), //
title: Text('地图显示 - ${currentFloor + 1}'), //
backgroundColor: Colors.green, // 绿
),
body: Column(

@ -20,7 +20,7 @@ class _MuseumInfoPageState extends State<MuseumInfoPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('天津博物馆'),
title: const Text('天津博物馆'),
backgroundColor: Colors.green,
actions: [
IconButton(

@ -161,7 +161,7 @@ class Service2 extends StatelessWidget {
' 个人通过网上预约,团体通过电话预约的方式进馆参观\n'
'\n'
' 1.微信公众号预约\n'
' 微信关注“天津博物馆”或者“天津博物馆TJM”微信公众号点击“参观天博”菜单进行预约选择\n'
' 微信关注“天津博物馆”或者“天津博物馆TJM”微信公众号点击“参观天博”菜单进行预约选择'
'合适的场次前来参观。',
style: TextStyle(fontSize: 18),
textAlign: TextAlign.justify,

Loading…
Cancel
Save