diff --git a/lib/clickable_text_widget.dart b/lib/clickable_text_widget.dart new file mode 100644 index 0000000..dbbe70c --- /dev/null +++ b/lib/clickable_text_widget.dart @@ -0,0 +1,46 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class ClickableText extends StatelessWidget { + final List> textList; + ClickableText(this.textList); + + @override + Widget build(BuildContext context) { + return Center( + child: RichText( + text: TextSpan( + children: _getTextSpanList(), + ), + ), + ); + } + + List _getTextSpanList(){ + var textSpanList = []; + + for(var text in textList){ + if(text[0] == "rich"){ + TextSpan textSpan = TextSpan( + text: text[1], + style: TextStyle(color: Colors.blue), + recognizer: TapGestureRecognizer() + ..onTap = () { + launch( + '${text[2]}'); + }, + ); + textSpanList.add(textSpan); + } + else { + TextSpan textSpan = TextSpan( + text: text[1], + style: TextStyle(color: Colors.black), + ); + textSpanList.add(textSpan); + } + } + return textSpanList; + } +} \ No newline at end of file diff --git a/lib/general_utils.dart b/lib/general_utils.dart index c9a32f6..2560b44 100755 --- a/lib/general_utils.dart +++ b/lib/general_utils.dart @@ -1,5 +1,5 @@ import 'dart:ui'; -import 'package:desktop_linux/color_scheme_read_and_write_utils.dart'; +import 'color_scheme_read_and_write_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/header_area_ui.dart b/lib/header_area_ui.dart index 0ad18fc..6b64908 100755 --- a/lib/header_area_ui.dart +++ b/lib/header_area_ui.dart @@ -1,4 +1,4 @@ -import 'package:desktop_linux/section_title_ui.dart'; +import 'section_title_ui.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/lib/main.dart b/lib/main.dart index 1c42d3c..de6be8e 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,6 @@ -import 'package:desktop_linux/section_title_ui.dart'; -import 'package:desktop_linux/wallpaper_color_picker_modes_ui.dart'; +import 'section_title_ui.dart'; +import 'wallpaper_color_picker_modes_ui.dart'; import 'package:desktop_window/desktop_window.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/menu_ui.dart b/lib/menu_ui.dart index 68f490d..cc1939b 100755 --- a/lib/menu_ui.dart +++ b/lib/menu_ui.dart @@ -1,10 +1,9 @@ -import 'package:desktop_linux/toggle_button_ui.dart'; +import 'clickable_text_widget.dart'; +import 'toggle_button_ui.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'app_data.dart'; - - import 'menu_item_ui.dart'; class Menu extends StatelessWidget { @@ -12,6 +11,17 @@ class Menu extends StatelessWidget { @override Widget build(BuildContext context) { + final List> aboutSectionTextList = [ + ["normal", "\nLicense: "], + [ + "rich", + "BSD 3-Clause License (Revised)\n", + "https://www.tldrlegal.com/l/bsd3" + ], + ["normal", "\nCredit for icon: "], + ["rich", "Icons8\n", "https://icons8.com"], + ]; + return PopupMenuButton( icon: const Icon(Icons.menu), offset: Offset(-Get.width / 180, Get.width / 36), @@ -31,6 +41,9 @@ class Menu extends StatelessWidget { applicationVersion: packageInfo.version, applicationLegalese: "© ${DateTime.now().year} Tanbir Jishan. All Rights Reserved.", + children: [ + ClickableText(aboutSectionTextList), + ], ); }, ), diff --git a/lib/wallpaper_color_picker_modes_ui.dart b/lib/wallpaper_color_picker_modes_ui.dart index f5993c7..f0a0be9 100755 --- a/lib/wallpaper_color_picker_modes_ui.dart +++ b/lib/wallpaper_color_picker_modes_ui.dart @@ -1,4 +1,4 @@ -import 'package:desktop_linux/radio_tile_ui.dart'; +import 'radio_tile_ui.dart'; import 'package:flutter/material.dart'; import 'app_data.dart'; import 'color_area_ui.dart'; diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 1d33699..424097b 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -5,9 +5,13 @@ #include "generated_plugin_registrant.h" #include +#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) desktop_window_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWindowPlugin"); desktop_window_plugin_register_with_registrar(desktop_window_registrar); + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 2829647..d4196a6 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST desktop_window + url_launcher_linux ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/pubspec.lock b/pubspec.lock index bf17d86..6539adc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -106,7 +106,7 @@ packages: name: get url: "https://pub.dartlang.org" source: hosted - version: "4.2.4" + version: "4.3.8" http: dependency: transitive description: @@ -155,7 +155,7 @@ packages: name: package_info_plus url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" package_info_plus_linux: dependency: transitive description: @@ -273,6 +273,48 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.9" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" vector_math: dependency: transitive description: @@ -289,4 +331,4 @@ packages: version: "2.2.5" sdks: dart: ">=2.13.0 <3.0.0" - flutter: ">=1.20.0" + flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index e9259a6..bb4a90a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: desktop_linux +name: Kolorify description: A kde plasma accent color changer # The following line prevents the package from being accidentally published to @@ -39,6 +39,7 @@ dependencies: palette_generator: ^0.3.0 flex_color_picker: ^2.1.2 package_info_plus: ^1.0.4 + url_launcher: ^6.0.9 dev_dependencies: flutter_test: