@@ -2,6 +2,8 @@ import 'package:get/get.dart';
22import 'widgets/version_dialog.dart' ;
33import 'package:pure_live/common/index.dart' ;
44import 'package:url_launcher/url_launcher.dart' ;
5+ import 'package:markdown_widget/config/configs.dart' ;
6+ import 'package:markdown_widget/widget/markdown_block.dart' ;
57
68class AboutPage extends StatefulWidget {
79 const AboutPage ({super .key});
@@ -29,7 +31,6 @@ class _AboutPageState extends State<AboutPage> {
2931 },
3032 ),
3133 ListTile (title: Text (S .of (context).what_is_new), onTap: showNewFeaturesDialog),
32- ListTile (title: Text (S .of (context).check_update), onTap: () => showCheckUpdateDialog (context)),
3334 ListTile (
3435 title: const Text ('历史记录' ),
3536 subtitle: const Text ('历史版本更新记录' ),
@@ -59,7 +60,7 @@ class _AboutPageState extends State<AboutPage> {
5960 void showCheckUpdateDialog (BuildContext context) async {
6061 showDialog (
6162 context: Get .context! ,
62- builder: (context) => VersionUtil .hasNewVersion () ? NewVersionDialog () : const NoNewVersionDialog (),
63+ builder: (context) => VersionUtil .hasNewVersion () ? NewVersionDialog () : NoNewVersionDialog (),
6364 );
6465 }
6566
@@ -73,21 +74,41 @@ class _AboutPageState extends State<AboutPage> {
7374 }
7475
7576 void showNewFeaturesDialog () {
77+ final config = Get .isDarkMode ? MarkdownConfig .darkConfig : MarkdownConfig .defaultConfig;
78+ final mediaQuery = MediaQuery .of (context);
79+ final maxWidth = mediaQuery.size.width * 0.9 ;
80+ final maxHeight = mediaQuery.size.height * 0.7 ;
7681 showDialog (
7782 context: context,
78- builder: (context) => AlertDialog (
79- title: Text (S .of (context).what_is_new),
80- content: Column (
81- crossAxisAlignment: CrossAxisAlignment .start,
82- mainAxisSize: MainAxisSize .min,
83- children: [
84- Text ('Version ${VersionUtil .latestVersion }' ),
85- const SizedBox (height: 20 ),
86- Text (VersionUtil .latestUpdateLog, style: Theme .of (context).textTheme.bodySmall),
87- const SizedBox (height: 10 ),
88- ],
89- ),
90- ),
83+ builder: (context) {
84+ return AlertDialog (
85+ title: Text (S .of (context).what_is_new),
86+ content: ConstrainedBox (
87+ constraints: BoxConstraints (maxWidth: maxWidth, maxHeight: maxHeight),
88+ child: SingleChildScrollView (
89+ child: Column (
90+ crossAxisAlignment: CrossAxisAlignment .start,
91+ mainAxisSize: MainAxisSize .min,
92+ children: [
93+ TextButton (
94+ onPressed: () {
95+ Navigator .pop (context);
96+ launchUrl (
97+ Uri .parse ('https://github.com/liuchuancong/pure_live' ),
98+ mode: LaunchMode .externalApplication,
99+ );
100+ },
101+ child: const Text ('本软件开源免费' , style: TextStyle (fontSize: 20 )),
102+ ),
103+ MarkdownBlock (data: VersionUtil .latestUpdateLog, config: config),
104+ const SizedBox (height: 10 ),
105+ ],
106+ ),
107+ ),
108+ ),
109+ actionsAlignment: MainAxisAlignment .start,
110+ );
111+ },
91112 );
92113 }
93114}
0 commit comments