diff --git a/assets/images/icons/SETTINGS-WHITE-with-circle.png b/assets/images/icons/SETTINGS-WHITE-with-circle.png index f962e184..177afcc1 100644 Binary files a/assets/images/icons/SETTINGS-WHITE-with-circle.png and b/assets/images/icons/SETTINGS-WHITE-with-circle.png differ diff --git a/assets/images/icons/SETTINGS-WHITE.png b/assets/images/icons/SETTINGS-WHITE.png index aed6a76e..4d7fcf2b 100644 Binary files a/assets/images/icons/SETTINGS-WHITE.png and b/assets/images/icons/SETTINGS-WHITE.png differ diff --git a/lib/constants/app_constants.dart b/lib/constants/app_constants.dart index f2d66a2a..4eba1944 100644 --- a/lib/constants/app_constants.dart +++ b/lib/constants/app_constants.dart @@ -89,7 +89,7 @@ const String FILE_DOWNLOAD_SUCCESSFUL = 'File download successful.'; const String SELECT_DEFAULT_SAVE_DESTINATION_FOR_THIS_DEVICE = 'Select default save destination for this device.'; -const String CURRENT_SAVE_DESTINATION = 'Current save destination:'; +const String CURRENT_SAVE_DESTINATION = 'Current Save Destination:'; const String GENERATION_CODE = 'Generating Code'; const String SEEN = 'seen'; const String PATH = 'path'; @@ -170,7 +170,6 @@ const String SETTINGS_SCREEN_SELECT_A_FOLDER_BUTTON = 'SETTINGS_SCREEN_SELECT_A_FOLDER_BUTTON'; const String SETTINGS_SCREEN_BOTTOM_SPACE_PLACEHOLDER = 'SETTINGS_SCREEN_BOTTOM_SPACE_PLACEHOLDER'; - const String ANDROID_DOWNLOADS_FOLDER_PATH = '/storage/emulated/0/Download'; const String WINDOW_TITLE = "Destiny"; @@ -178,12 +177,13 @@ const String WINDOW_TITLE = "Destiny"; const String APP_ID = "AppID:"; const String TRANSIT_RELAY = "Transit Relay URL:"; const String MAILBOX_URL = "Mailbox URL:"; -const String ENV_SETTINGS = 'Environment settings:'; +const String ENV_SETTINGS = 'Environment Settings:'; const String VERSION = 'Version:'; const String DEFAULT_SAVE_DESTINATION = 'Default save destination:'; const String FEEDBACK = 'Feedback'; const String FQA = 'FAQ'; const String PRIVACY = 'Privacy Policy'; +const String TERMS = 'Terms'; const String FEEDBACK_LINK = 'https://github.com/LeastAuthority/destiny/blob/main/README.md'; @@ -191,6 +191,8 @@ const String FQA_LINK = 'https://github.com/LeastAuthority/destiny/blob/main/README.md'; const String PRIVACY_LINK = 'https://github.com/LeastAuthority/destiny/blob/main/README.md'; +const String TERMS_LINK = + 'https://github.com/LeastAuthority/destiny/blob/main/TERMS.md'; const String ERR_WRONG_CODE_RECEIVER = """Oops.. If you’re sure this is the right code: Either the sender is no longer connected, or the code was already used. diff --git a/lib/views/desktop/introduction-slider.dart b/lib/views/desktop/introduction-slider.dart index 957ad19e..a6cfd109 100644 --- a/lib/views/desktop/introduction-slider.dart +++ b/lib/views/desktop/introduction-slider.dart @@ -95,6 +95,7 @@ class IntroScreenState extends State { showNextBtn: false, showPrevBtn: false, showDoneBtn: false, + desktopActionButtonEnabled: true, onDonePress: this.onDonePress, colorDot: Theme.of(context).scaffoldBackgroundColor, colorActiveDot: Theme.of(context).colorScheme.secondary, diff --git a/lib/views/desktop/settings.dart b/lib/views/desktop/settings.dart index e5533ebf..5d92778b 100644 --- a/lib/views/desktop/settings.dart +++ b/lib/views/desktop/settings.dart @@ -2,9 +2,11 @@ import 'package:destiny/config/routes/routes.dart'; import 'package:destiny/config/theme/colors.dart'; import 'package:destiny/constants/app_constants.dart'; import 'package:destiny/views/desktop/widgets/DTButtonWithBackground.dart'; +import 'package:destiny/views/desktop/widgets/DTInfo.dart'; import 'package:destiny/views/desktop/widgets/custom-app-bar.dart'; import 'package:destiny/views/shared/settings.dart'; import 'package:destiny/views/widgets/Heading.dart'; +import 'package:destiny/views/widgets/Links.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -41,9 +43,16 @@ class _SettingsState extends SettingsShared { height: double.infinity, color: Theme.of(context).dialogBackgroundColor, padding: - EdgeInsets.only(left: 8.0, right: 8.0, top: 80.0.h), + EdgeInsets.only(left: 8.0, right: 8.0, top: 16.0.h), child: Column( + crossAxisAlignment: CrossAxisAlignment.center, children: [ + Container( + margin: EdgeInsets.only(top: 25.0, bottom: 25.0), + child: Links( + fontSize: 17.0, + ), + ), Heading( title: SELECT_DEFAULT_SAVE_DESTINATION_FOR_THIS_DEVICE, @@ -53,30 +62,18 @@ class _SettingsState extends SettingsShared { ), Column( children: [ - Heading( - title: '$CURRENT_SAVE_DESTINATION', - textAlign: TextAlign.center, - marginTop: 110.0.h, - path: path, - textStyle: Theme.of(context).textTheme.headline6, - key: Key(SETTINGS_SCREEN_HEADING), - ), SizedBox( - height: 45.0.h, + height: 16.0, ), DTButtonWithBackground( onPressed: selectSaveDestination, title: SELECT_A_FOLDER, width: 150.0, disabled: false, - ) + ), + DTInfo(path: path, version: version) ], ), - Text("version: $version", - style: Theme.of(context) - .textTheme - .labelLarge - ?.copyWith(color: Colors.white)), ], )), ), diff --git a/lib/views/desktop/widgets/DTInfo.dart b/lib/views/desktop/widgets/DTInfo.dart new file mode 100644 index 00000000..0d539242 --- /dev/null +++ b/lib/views/desktop/widgets/DTInfo.dart @@ -0,0 +1,112 @@ +import 'package:destiny/constants/app_constants.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../../../config/theme/colors.dart'; +import '../../../constants/asset_path.dart'; +import '../../widgets/Heading.dart'; + +class DTInfo extends StatelessWidget { + final String? path; + final String version; + DTInfo({ + Key? key, + required this.path, + required this.version, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(top: 16.0), + padding: EdgeInsets.all(16.0), + constraints: BoxConstraints( + maxHeight: MediaQuery.of(context).size.height / 3, + maxWidth: 900, + ), + decoration: BoxDecoration( + color: Theme.of(context).scaffoldBackgroundColor, + borderRadius: BorderRadius.all(Radius.circular(4.0)), + border: Border.all(width: 2.0, color: CustomColors.purple), + ), + child: SingleChildScrollView( + child: Column( + key: Key(SETTINGS_SCREEN_CONTENT), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Heading( + title: CURRENT_SAVE_DESTINATION, + textAlign: TextAlign.left, + marginTop: 10.0.h, + textStyle: TextStyle( + fontFamily: MONTSERRAT, + fontSize: Theme.of(context).textTheme.headline6?.fontSize, + color: Theme.of(context).textTheme.headline6?.color, + ), + ), + Heading( + textAlign: TextAlign.left, + title: path, + textStyle: Theme.of(context).textTheme.headline6, + key: Key(SETTINGS_SCREEN_HEADING), + ), + SizedBox( + height: 10.0, + ), + Divider(height: 1.0, color: Colors.white), + Heading( + title: VERSION, + textAlign: TextAlign.left, + marginTop: 10.0.h, + textStyle: TextStyle( + fontFamily: MONTSERRAT, + fontSize: Theme.of(context).textTheme.headline6?.fontSize, + color: Theme.of(context).textTheme.headline6?.color, + ), + ), + Heading( + textAlign: TextAlign.left, + marginTop: 5.0, + title: version, + textStyle: Theme.of(context).textTheme.headline6, + ), + SizedBox( + height: 10.0, + ), + Divider(height: 1.0, color: Colors.white), + Heading( + title: ENV_SETTINGS, + textAlign: TextAlign.left, + marginTop: 10.0.h, + textStyle: TextStyle( + fontFamily: MONTSERRAT, + fontSize: Theme.of(context).textTheme.headline6?.fontSize, + color: Theme.of(context).textTheme.headline6?.color, + ), + ), + Heading( + title: '$MAILBOX_URL ${leastAuthority.rendezvousUrl}', + textAlign: TextAlign.left, + marginTop: 10.0.h, + textStyle: Theme.of(context).textTheme.headline6), + Heading( + title: '$TRANSIT_RELAY ${leastAuthority.transitRelayUrl}', + textAlign: TextAlign.left, + marginTop: 10.0.h, + textStyle: Theme.of(context).textTheme.headline6), + Heading( + title: '$APP_ID ${leastAuthority.appId}', + textAlign: TextAlign.left, + marginTop: 10.0.h, + textStyle: Theme.of(context).textTheme.headline6), + SizedBox( + height: 132.0, + ), + ], + ), + ]))); + } +} diff --git a/lib/views/desktop/widgets/custom-app-bar.dart b/lib/views/desktop/widgets/custom-app-bar.dart index c58988a5..52da2901 100644 --- a/lib/views/desktop/widgets/custom-app-bar.dart +++ b/lib/views/desktop/widgets/custom-app-bar.dart @@ -81,7 +81,7 @@ class _CustomAppBarState extends State { route: SETTINGS_ROUTE, title: SETTINGS, currentRoute: path, - icon: INFO_ICON, + icon: SETTINGS_ICON, alignment: CrossAxisAlignment.end, ), ], diff --git a/lib/views/mobile/Info.dart b/lib/views/mobile/Info.dart index 79f10176..2f3f11a2 100644 --- a/lib/views/mobile/Info.dart +++ b/lib/views/mobile/Info.dart @@ -1,4 +1,3 @@ -import 'package:destiny/config/theme/colors.dart'; import 'package:destiny/constants/app_constants.dart'; import 'package:destiny/constants/asset_path.dart'; import 'package:destiny/views/mobile/widgets/buttons/Button.dart'; @@ -7,7 +6,8 @@ import 'package:destiny/views/shared/settings.dart'; import 'package:destiny/views/widgets/Heading.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:url_launcher/url_launcher.dart'; + +import '../widgets/Links.dart'; class Info extends SettingsState { Info({Key? key}) : super(key: key); @@ -39,49 +39,8 @@ class _SettingsState extends SettingsShared { children: [ Column( children: [ - Row( - children: [ - GestureDetector( - child: Text(FEEDBACK, - style: TextStyle( - decoration: TextDecoration.underline, - color: CustomColors.lighterBlue, - fontSize: 16.0, - )), - onTap: () async { - const url = FEEDBACK_LINK; - launch(url); - }, - ), - SizedBox( - width: 24.0, - ), - GestureDetector( - child: Text(FQA, - style: TextStyle( - decoration: TextDecoration.underline, - color: CustomColors.lighterBlue, - fontSize: 16.0)), - onTap: () async { - const url = FQA_LINK; - launch(url); - }, - ), - SizedBox( - width: 24.0, - ), - GestureDetector( - child: Text(PRIVACY, - style: TextStyle( - decoration: TextDecoration.underline, - color: CustomColors.lighterBlue, - fontSize: 16.0)), - onTap: () async { - const url = PRIVACY_LINK; - launch(url); - }, - ), - ], + Links( + fontSize: 16.0, ), SizedBox( height: 10.0, diff --git a/lib/views/widgets/Links.dart b/lib/views/widgets/Links.dart new file mode 100644 index 00000000..9bcc5aaa --- /dev/null +++ b/lib/views/widgets/Links.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; + +import '../../config/theme/colors.dart'; +import '../../constants/app_constants.dart'; + +class Links extends StatelessWidget { + final double? fontSize; + Links({Key? key, this.fontSize}) : super(key: key); + @override + Widget build(BuildContext context) { + GestureDetector getLink(String title, String url) { + return GestureDetector( + child: Text(title, + style: TextStyle( + decoration: TextDecoration.underline, + color: CustomColors.lighterBlue, + fontSize: fontSize, + )), + onTap: () async { + launch(url); + }, + ); + } + + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + getLink(FEEDBACK, FEEDBACK_LINK), + SizedBox( + width: 24.0, + ), + getLink(FQA, FQA_LINK), + SizedBox( + width: 24.0, + ), + getLink(PRIVACY, PRIVACY_LINK), + SizedBox( + width: 24.0, + ), + getLink(TERMS, TERMS_LINK), + ], + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 1c70ef5d..10a13b4c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -34,7 +34,7 @@ dependencies: intro_slider: git: url: https://github.com/shareef-dweikat/flutter-intro-slider - ref: a9bb492412c68419900750fe12e0487e3a1168fb + ref: fb79b4ded0fc915d14b482737b18aa948838c1f9 expand_widget: git: url: https://github.com/shareef-dweikat/expand_widget