YuYouShui_Branch
黎超凡 2 years ago
parent 10515884ae
commit 8c955d3167

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

@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"sqflite","path":"C:\\\\Users\\\\17651\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.3.0\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"sqflite","path":"C:\\\\Users\\\\17651\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.3.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\17651\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.3.0\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"sqflite","dependencies":[]}],"date_created":"2023-11-07 23:02:18.318652","version":"3.13.3"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"sqflite","path":"C:\\\\Users\\\\17651\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.3.0\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"sqflite","path":"C:\\\\Users\\\\17651\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.3.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\17651\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite-2.3.0\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"sqflite","dependencies":[]}],"date_created":"2023-11-09 11:11:11.867067","version":"3.13.3"}

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="dataSourceStorageLocal" created-in="IU-211.7628.21">
<data-source name="travelguide" uuid="a84e8ed8-57ec-4250-8841-7f4c909379d5">
<data-source name="travelguide" uuid="1c4f5c08-c312-4a8a-8868-0f8ff6be536a">
<database-info product="SQLite" version="3.43.0" jdbc-version="4.2" driver-name="SQLite JDBC" driver-version="3.43.0.0" dbms="SQLITE" exact-version="3.43.0" exact-driver-version="3.43">
<identifier-quote-string>&quot;</identifier-quote-string>
</database-info>

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="travelguide" uuid="a84e8ed8-57ec-4250-8841-7f4c909379d5">
<data-source source="LOCAL" name="travelguide" uuid="1c4f5c08-c312-4a8a-8868-0f8ff6be536a">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:C:\Users\17651\Documents\AndroidStudio\DeviceExplorer\Pixel_3_XL_API_30 [emulator-5554]\data\user\0\com.example.travelguide\databases\travelguide.db</jdbc-url>
<jdbc-url>jdbc:sqlite:C:\Users\17651\Documents\AndroidStudio\DeviceExplorer\Pixel_3_XL_API_30 [emulator-5554]\data\data\com.example.travelguide\databases\travelguide.db</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
<libraries>
<library>

File diff suppressed because one or more lines are too long

@ -1,4 +1,4 @@
#Tue Nov 07 23:02:54 CST 2023
#Thu Nov 09 11:11:49 CST 2023
base.0=E\:\\travelguideProject\\src\\build\\app\\intermediates\\dex\\debug\\mergeDexDebug\\classes.dex
renamed.0=classes.dex
path.0=classes.dex

@ -1 +1 @@
01ced3eca2ee439bb1b0cc0c9f7ebaa1c3547682
56f09655ff532597ed660d7244a6919bcafca0d8

@ -25,7 +25,12 @@ void main() async{
//
await database.insert('CollectionInfo', {
'CollectionID': 0,
'MuseumName': '',
'CollectionName': '',
'CollectionDetail':
'',
'ImagePath':''
});
await database.close();
@ -46,6 +51,36 @@ void main() async{
}
deleteCollectionInfoData();
Future<void> insertMuseumInfoData() async {
final databasePath = await getDatabasesPath();
final path = join(databasePath, 'travelguide.db');
final database = await openDatabase(path);
await database.insert('MuseumInfo', {
'MuseumName': '',
'MuseumDetail': '',
'ImagePath': ''
});
await database.close();
}
insertMuseumInfoData();
Future<void> deleteMuseumInfoData() async {
final databasePath = await getDatabasesPath();
final path = join(databasePath, 'travelguide.db');
final database = await openDatabase(path);
await database.rawDelete(
'DELETE FROM MuseumInfo WHERE MuseumName = **'
);
await database.close();
}
deleteMuseumInfoData();
runApp(MaterialApp(
initialRoute: '/', //
routes: {
@ -102,7 +137,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
BottomNavigationBarItem(
icon: Icon(Icons.map),
label: '地图',
label: '地图显示',
),
],
onTap: _onTabTapped,

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

@ -17,18 +17,32 @@ class MyDatabase {
}
static Future<void> _createTables(Database db, int version) async {
await _createCollectionInfoTable(db, version);
// await _createMuseumInfoTable(db, version);
// await _createCollectionInfoTable(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");
}

@ -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,6 +27,7 @@ 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,

@ -87,8 +87,40 @@ class _collection0State extends State<collection0> {
});
},
children: [
_buildImage('assets/collection0-1.jpg', 150, 0, 2.0),
_buildImage('assets/collection0-2.jpg', 150, 0, 1.5),
FutureBuilder<List<CollectionInfo>>(
future: CollectionControl.fetchCollectionData(0),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator();
} else if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
} else {
if (snapshot.hasData && snapshot.data!.isNotEmpty) {
List<String> imagePaths = snapshot.data![0].imagePath.split(', ');
return _buildImage(imagePaths[0], 150, 0, 2.0);
} else {
return Text('No data available');
}
}
},
),
FutureBuilder<List<CollectionInfo>>(
future: CollectionControl.fetchCollectionData(0),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator();
} else if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
} else {
if (snapshot.hasData && snapshot.data!.isNotEmpty) {
List<String> imagePaths = snapshot.data![0].imagePath.split(', ');
return _buildImage(imagePaths[1], 150, 0, 1.5);
} else {
return Text('No data available');
}
}
},
),
],
),
),

Loading…
Cancel
Save