Skip to content

Commit

Permalink
icon experiment, reorder tools
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshtrivedi committed Jan 1, 2022
1 parent 008185d commit aa97d3b
Show file tree
Hide file tree
Showing 23 changed files with 176 additions and 59 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ Online utilities for formatting, encoding/decoding etc are dangerous to use (man
This app is written in Flutter and therefore, works on MacOS, Linux, Windows and even Web if your org would like to host it internally as a webapp. But do not expect this to work on Android and iOS.

Make sure to [read the LICENSE](/LICENSE.md).

### How to build:

MacOS:
`flutter build macos --release` will generate the .app file in `build/macos/Build/Products/Release/devtools.app`.
28 changes: 17 additions & 11 deletions lib/view/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:devtools/view/tabs/text_to_qr_code_screen.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:macos_ui/macos_ui.dart';
import 'package:url_launcher/url_launcher.dart';

class DashboardScreen extends StatefulWidget {
const DashboardScreen({Key? key}) : super(key: key);
Expand All @@ -17,20 +18,16 @@ class DashboardScreen extends StatefulWidget {
}

class _DashboardScreenState extends State<DashboardScreen> {
double ratingValue = 0;
double sliderValue = 0;
bool value = false;

int pageIndex = 0;

final List<Widget> pages = [
const Base64EncodingDecodingScreen(),
const JsonFormatValidateScreen(),
const JWTDebuggerScreen(),
const JsonToYamlScreen(),
const YamlToJsonScreen(),
const QrCodeToTextScreen(),
const TextToQrCodeScreen(),
const JWTDebuggerScreen(),
];

Color textLuminance(Color backgroundColor) {
Expand All @@ -39,6 +36,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
: Colors.white;
}

_launchURL() async {
const url = 'https://github.com/nileshtrivedi/devtoolbox/discussions';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}

@override
Widget build(BuildContext context) {
return MacosWindow(
Expand All @@ -57,7 +63,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
primary: Colors.white,
textStyle: const TextStyle(fontSize: 12),
),
onPressed: () {},
onPressed: _launchURL,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down Expand Up @@ -107,7 +113,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white70,
),
label: Text(
'JWT Debugger',
'JSON to YAML',
style: TextStyle(fontSize: 13),
),
),
Expand All @@ -117,7 +123,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white70,
),
label: Text(
'JSON to YAML',
'YAML to JSON',
style: TextStyle(fontSize: 13),
),
),
Expand All @@ -127,7 +133,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white70,
),
label: Text(
'YAML to JSON',
'QR Image to Text',
style: TextStyle(fontSize: 13),
),
),
Expand All @@ -137,7 +143,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white70,
),
label: Text(
'QR Image to Text',
'Text to QR Image',
style: TextStyle(fontSize: 13),
),
),
Expand All @@ -147,7 +153,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white70,
),
label: Text(
'Text to QR Image',
'JWT Debugger',
style: TextStyle(fontSize: 13),
),
),
Expand Down
4 changes: 4 additions & 0 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
#include "generated_plugin_registrant.h"

#include <native_context_menu/native_context_menu_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) native_context_menu_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "NativeContextMenuPlugin");
native_context_menu_plugin_register_with_registrar(native_context_menu_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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

list(APPEND FLUTTER_PLUGIN_LIST
native_context_menu
url_launcher_linux
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import FlutterMacOS
import Foundation

import native_context_menu
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
NativeContextMenuPlugin.register(with: registry.registrar(forPlugin: "NativeContextMenuPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
6 changes: 6 additions & 0 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@ PODS:
- FlutterMacOS (1.0.0)
- native_context_menu (0.0.1):
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS

DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- native_context_menu (from `Flutter/ephemeral/.symlinks/plugins/native_context_menu/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)

EXTERNAL SOURCES:
FlutterMacOS:
:path: Flutter/ephemeral
native_context_menu:
:path: Flutter/ephemeral/.symlinks/plugins/native_context_menu/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos

SPEC CHECKSUMS:
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
native_context_menu: 8b710e17c5962cf3f005b805eb97cce668b3839a
url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4

PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 63 additions & 47 deletions macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,84 @@
{
"images" : [
"images": [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "app_icon_16.png",
"scale" : "1x"
"size": "128x128",
"expected-size": "128",
"filename": "128.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "mac",
"scale": "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "app_icon_32.png",
"scale" : "2x"
"size": "256x256",
"expected-size": "256",
"filename": "256.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "mac",
"scale": "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "app_icon_32.png",
"scale" : "1x"
"size": "128x128",
"expected-size": "256",
"filename": "256.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "mac",
"scale": "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "app_icon_64.png",
"scale" : "2x"
"size": "256x256",
"expected-size": "512",
"filename": "512.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "mac",
"scale": "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "app_icon_128.png",
"scale" : "1x"
"size": "32x32",
"expected-size": "32",
"filename": "32.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "mac",
"scale": "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "app_icon_256.png",
"scale" : "2x"
"size": "512x512",
"expected-size": "512",
"filename": "512.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "mac",
"scale": "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "app_icon_256.png",
"scale" : "1x"
"size": "16x16",
"expected-size": "16",
"filename": "16.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "mac",
"scale": "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "app_icon_512.png",
"scale" : "2x"
"size": "16x16",
"expected-size": "32",
"filename": "32.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "mac",
"scale": "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "app_icon_512.png",
"scale" : "1x"
"size": "32x32",
"expected-size": "64",
"filename": "64.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "mac",
"scale": "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "app_icon_1024.png",
"scale" : "2x"
"size": "512x512",
"expected-size": "1024",
"filename": "1024.png",
"folder": "Assets.xcassets/AppIcon.appiconset/",
"idiom": "mac",
"scale": "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit aa97d3b

Please sign in to comment.