diff --git a/src/lib/main.dart b/src/lib/main.dart index cdbe9745..a55ece4e 100644 --- a/src/lib/main.dart +++ b/src/lib/main.dart @@ -24,10 +24,11 @@ void main() async{ // 插入示例数据 await database.insert('CollectionInfo', { - 'CollectionID': 0, - 'MuseumName': '博物馆名称', - 'CollectionName': '示例藏品', - 'CollectionDetail': '这是示例藏品的详细描述', + 'CollectionID': 4, + 'MuseumName': '天津市博物馆', + 'CollectionName': '嬴霝德壶', + 'CollectionDetail':'西周 一级\n' + '高44.6厘米 口径14.5厘米\n', }); await database.close(); diff --git a/src/lib/travelguideapp/ui/boundary/MuseumInfoExtendPage.dart b/src/lib/travelguideapp/ui/boundary/MuseumInfoExtendPage.dart index 3ed02e88..7d0c1760 100644 --- a/src/lib/travelguideapp/ui/boundary/MuseumInfoExtendPage.dart +++ b/src/lib/travelguideapp/ui/boundary/MuseumInfoExtendPage.dart @@ -1,32 +1,29 @@ import 'package:flutter/material.dart'; + class MuseumInfoExtendPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('天津博物馆'), - backgroundColor: Colors.green + title: Text('天津博物馆'), + backgroundColor: Colors.green, ), body: Center( - child: Text( - '天津博物馆(天津美术馆、李叔同故居纪念\n' - '馆)位于天津市河西区平江道62号,是展示\n' - '中国古代艺术及天津城市发展历史的大型艺\n' - '术历史类综合性博物,是天津地区最大的集\n' - '收藏、保护、研究、陈列、教育为一体的大\n' - '型公益性文化机构和对外文化交流的窗口。\n' - '天津博物馆的前身可追溯至民国七年(1918\n' - '年)6月1日,正式成立了天津博物院;2004\n' - '年由原天津市艺术博物馆和天津市历史博物\n' - '馆合并组建;2007年底,天津博物馆旧馆对\n' - '外免费开放;2008年,天津博物馆新馆开工\n' - '建设;2012年5月,天津博物馆新馆建成对\n' - '外开放。\n', - style: TextStyle(// 文字颜色白色 - fontSize: 18, + child: Padding( + padding: const EdgeInsets.all(16.0), // 设置页边距 + child: Text( + ' 天津博物馆的馆藏特色是中国历代艺术品和近现代历史文献、地方史料并重,截至2019年末,' + '有古代青铜器、陶瓷器、书法、绘画、玉器、玺印、文房用具、甲骨、' + '货币、邮票、敦煌遗书、竹木牙角器、地方民间工艺及近代历史文献等各类藏品近20万件,' + '图书资料20万册, 珍贵文物137909件/套。\n' + ' 2008年,天津博物馆被评为国家一级博物馆,是全国青少年爱国主义教育基地。' + '2018年10月11日,天津博物馆入选“全国中小学生研学实践教育基地”名单。', + style: TextStyle( + fontSize: 18, + ), ), ), ), ); } -} \ No newline at end of file +} diff --git a/src/lib/travelguideapp/ui/boundary/MuseumInfoPage.dart b/src/lib/travelguideapp/ui/boundary/MuseumInfoPage.dart index f79b3ed3..adc54ab2 100644 --- a/src/lib/travelguideapp/ui/boundary/MuseumInfoPage.dart +++ b/src/lib/travelguideapp/ui/boundary/MuseumInfoPage.dart @@ -42,20 +42,75 @@ class _MuseumInfoPageState extends State { children: [ // 添加自动滚动图像轮播 AutoImageSlider(), - _buildCustomButton('查看博物馆信息', 45, 10, () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => MuseumInfoExtendPage(), + Padding( + padding: const EdgeInsets.all(16.0), + child: Align( + alignment: Alignment.centerLeft, // 左对齐 + child: InkWell( + onTap: () { + // 导航到MuseumInfoExtendPage + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => MuseumInfoExtendPage(), + ), + ); + }, + child: Text( + ' 天津博物馆位于天津市河西区平江道62号,' + '是展示中国古代艺术及天津城市发展历史的大型艺术历史类综合性博物,' + '是天津地区最大的集收藏、保护、研究、陈列、教育为一体的大型公益性文化机构和对外文化交流的窗口。\n' + ' 天津博物馆的前身可追溯至民国七年(1918年)6月1日,正式成立了天津博物院;' + '2004年由原天津市艺术博物馆和天津市历史博物馆合并组建;2007年底,天津博物馆旧馆对外免费开放;' + '2008年,天津博物馆新馆开工建设;' + '2012年5月,天津博物馆新馆建成对外开放。', + style: TextStyle( + fontSize: 16, + color: Colors.black, // 设置文本颜色为黑色 + ), + textAlign: TextAlign.left, + ), ), - ); - }), - _buildCustomButton('查看馆藏信息', 45, 20, () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => CollectionListPage(), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, // 将按钮居中 + children: [ + SizedBox(width: 20), + InkWell( + onTap: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => CollectionListPage(), + ), + ); + }, + child: Column( + children: [ + Container( + width: 80, + height: 80, + decoration: BoxDecoration( + color: Colors.green, + shape: BoxShape.circle, + ), + child: Icon( + Icons.calendar_view_month, // 替换为您想要的图标 + color: Colors.white, + size: 40, + ), + ), + Text( + '馆藏信息', + style: TextStyle( + fontSize: 18, + color: Colors.black, + ), + ), + ], + ), ), - ); - }), + ], + ), ], ), ), @@ -132,30 +187,3 @@ class _AutoImageSliderState extends State { ); } } - -// 用于构建按钮的函数 -Widget _buildCustomButton(String buttonText, double height, double verticalOffset, void Function() onPressed) { - return SizedBox( - height: height, - child: Transform.translate( - offset: Offset(0, verticalOffset), - child: ElevatedButton( - onPressed: onPressed, - style: ElevatedButton.styleFrom( - backgroundColor: Colors.green, - padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 10, - ), - ), - child: Text( - buttonText, - style: TextStyle( - color: Colors.white, - fontSize: 18, - ), - ), - ), - ), - ); -}