Skip to content

Commit

Permalink
Updated the about section
Browse files Browse the repository at this point in the history
  • Loading branch information
tantalising committed Aug 23, 2021
1 parent 30a0d96 commit b7ea638
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 12 deletions.
46 changes: 46 additions & 0 deletions 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<List<String>> textList;
ClickableText(this.textList);

@override
Widget build(BuildContext context) {
return Center(
child: RichText(
text: TextSpan(
children: _getTextSpanList(),
),
),
);
}

List<TextSpan> _getTextSpanList(){
var textSpanList = <TextSpan>[];

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;
}
}
2 changes: 1 addition & 1 deletion 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';
Expand Down
2 changes: 1 addition & 1 deletion 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';

Expand Down
4 changes: 2 additions & 2 deletions 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';
Expand Down
19 changes: 16 additions & 3 deletions lib/menu_ui.dart
@@ -1,17 +1,27 @@
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 {
const Menu({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
final List<List<String>> 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),
Expand All @@ -31,6 +41,9 @@ class Menu extends StatelessWidget {
applicationVersion: packageInfo.version,
applicationLegalese:
${DateTime.now().year} Tanbir Jishan. All Rights Reserved.",
children: [
ClickableText(aboutSectionTextList),
],
);
},
),
Expand Down
2 changes: 1 addition & 1 deletion 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';
Expand Down
4 changes: 4 additions & 0 deletions linux/flutter/generated_plugin_registrant.cc
Expand Up @@ -5,9 +5,13 @@
#include "generated_plugin_registrant.h"

#include <desktop_window/desktop_window_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

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);
}
1 change: 1 addition & 0 deletions linux/flutter/generated_plugins.cmake
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
desktop_window
url_launcher_linux
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
48 changes: 45 additions & 3 deletions pubspec.lock
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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"
3 changes: 2 additions & 1 deletion 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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b7ea638

Please sign in to comment.