2024-12-08 17:14:31 +08:00
import ' package:easy_localization/easy_localization.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:gap/gap.dart ' ;
import ' package:package_info_plus/package_info_plus.dart ' ;
import ' package:styled_widget/styled_widget.dart ' ;
2025-01-21 20:50:07 +08:00
import ' package:surface/widgets/navigation/app_scaffold.dart ' ;
2024-12-08 17:14:31 +08:00
import ' package:url_launcher/url_launcher_string.dart ' ;
class AboutScreen extends StatelessWidget {
const AboutScreen ( { super . key } ) ;
@ override
Widget build ( BuildContext context ) {
const denseButtonStyle = ButtonStyle ( visualDensity: VisualDensity ( vertical: - 4 ) ) ;
2025-01-21 20:50:07 +08:00
return AppScaffold (
appBar: AppBar (
leading: const PageBackButton ( ) ,
title: Text ( ' screenAbout ' ) . tr ( ) ,
) ,
body: SizedBox (
width: double . infinity ,
child: Column (
mainAxisAlignment: MainAxisAlignment . center ,
children: [
ClipRRect (
borderRadius: const BorderRadius . all ( Radius . circular ( 16 ) ) ,
child: Image . asset ( ' assets/icon/icon-light-radius.png ' , width: 120 , height: 120 ) ,
) ,
const Gap ( 8 ) ,
Text (
' Solian ' ,
style: Theme . of ( context ) . textTheme . titleLarge ! . copyWith ( fontSize: 36 ) ,
) ,
const Text (
' The Solar Network ' ,
style: TextStyle ( fontWeight: FontWeight . bold , fontSize: 16 ) ,
) ,
const Gap ( 8 ) ,
FutureBuilder (
future: PackageInfo . fromPlatform ( ) ,
builder: ( context , snapshot ) {
if ( ! snapshot . hasData ) {
return const SizedBox . shrink ( ) ;
}
2024-12-08 17:14:31 +08:00
2025-01-21 20:50:07 +08:00
return Text (
' v ${ snapshot . data ! . version } · ${ snapshot . data ! . buildNumber } ' ,
style: const TextStyle ( fontFamily: ' monospace ' ) ,
) ;
} ,
) ,
Text ( ' Copyright © ${ DateTime . now ( ) . year } Solsynth LLC ' ) ,
const Gap ( 16 ) ,
Container (
constraints: const BoxConstraints ( maxWidth: 280 ) ,
child: Wrap (
spacing: 4 ,
runSpacing: 4 ,
alignment: WrapAlignment . center ,
children: [
TextButton (
style: denseButtonStyle ,
child: Text ( ' appDetails ' ) . tr ( ) ,
onPressed: ( ) async {
final info = await PackageInfo . fromPlatform ( ) ;
2024-12-08 17:14:31 +08:00
2025-01-21 20:50:07 +08:00
if ( ! context . mounted ) return ;
showAboutDialog (
context: context ,
applicationName: ' Solian ' ,
applicationVersion: ' ${ info . version } + ${ info . buildNumber } ' ,
applicationLegalese:
' The Solar Network App is an intuitive and open-source social network and computing platform. Experience the freedom of a user-friendly design that empowers you to create and connect with communities on your own terms. Embrace the future of social networking with a platform that prioritizes your independence and privacy. ' ,
applicationIcon: ClipRRect (
borderRadius: const BorderRadius . all ( Radius . circular ( 16 ) ) ,
child: Image . asset (
' assets/icon/icon-light-radius.png ' ,
width: 60 ,
height: 60 ,
) ,
2024-12-08 17:14:31 +08:00
) ,
2025-01-21 20:50:07 +08:00
) ;
} ,
) ,
TextButton (
style: denseButtonStyle ,
child: Text ( ' termRelated ' ) . tr ( ) ,
onPressed: ( ) {
launchUrlString ( ' https://solsynth.dev/terms ' ) ;
} ,
) ,
TextButton (
style: denseButtonStyle ,
child: Text ( ' serviceStatus ' ) . tr ( ) ,
onPressed: ( ) {
launchUrlString ( ' https://status.solsynth.dev ' ) ;
} ,
) ,
] ,
) ,
) . center ( ) ,
const Gap ( 16 ) ,
const Text (
' Open-sourced under AGPLv3 ' ,
style: TextStyle (
fontWeight: FontWeight . w300 ,
fontSize: 12 ,
) ,
2024-12-08 17:14:31 +08:00
) ,
2025-01-21 20:50:07 +08:00
] ,
) ,
2024-12-08 17:14:31 +08:00
) ,
) ;
}
}