Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ PODS:
- SwiftyGif (5.4.5)
- uri_content (0.0.1):
- Flutter
- url_launcher_ios (0.0.1):
- Flutter

DEPENDENCIES:
- accessing_security_scoped_resource (from `.symlinks/plugins/accessing_security_scoped_resource/darwin`)
Expand All @@ -77,6 +79,7 @@ DEPENDENCIES:
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- super_native_extensions (from `.symlinks/plugins/super_native_extensions/ios`)
- uri_content (from `.symlinks/plugins/uri_content/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)

SPEC REPOS:
trunk:
Expand Down Expand Up @@ -112,6 +115,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/super_native_extensions/ios"
uri_content:
:path: ".symlinks/plugins/uri_content/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
accessing_security_scoped_resource: 4a87897646efbc3a4578e28ea4c08083d7bf3e67
Expand All @@ -131,6 +136,7 @@ SPEC CHECKSUMS:
super_native_extensions: b763c02dc3a8fd078389f410bf15149179020cb4
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
uri_content: 70a99850f89322ef5eca2e69451ee38221b917ec
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b

PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e

Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,7 @@
</array>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>NSLocalNetworkUsageDescription</key>
<string>To send files app needs to find devices in your network.</string>
</dict>
</plist>
2 changes: 2 additions & 0 deletions ios/Runner/Runner.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.multicast</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.jett</string>
Expand Down
26 changes: 15 additions & 11 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:forui/forui.dart';
import 'package:go_router/go_router.dart';
import 'package:jett/discovery/konst.dart';
import 'package:jett/platform/platform_api.dart';
import 'package:jett/screen/about_screen.dart';
import 'package:jett/screen/apk_picker_screen.dart';
import 'package:jett/screen/home_screen.dart';
import 'package:jett/screen/transfer_screen.dart';
import 'package:jett/utils/device_info.dart';
import 'package:jett/utils/package_info.dart';
import 'package:flutter/material.dart';
import 'package:forui/forui.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();

PlatformApi.instance.init();
await Future.wait([PackageInfoHelper.init(), DeviceInfoHelper.init()]);

PlatformApi.instance.getPlatformVersion().then((value) {
debugPrint('Running on: ${value.string}');
});
if (Platform.isAndroid || Platform.isIOS) {
PlatformApi.instance.init();
PlatformApi.instance.getPlatformVersion().then((value) {
debugPrint('Running on: ${value.string}');
});
}

runApp(const MyApp());
}
Expand Down Expand Up @@ -47,14 +52,13 @@ final _router = GoRouter(
GoRoute(path: '/', builder: (context, state) => HomeScreen()),
GoRoute(
path: '/send',
builder: (context, state) =>
TransferScreen(transferType: TransferType.send),
builder: (_, _) => TransferScreen(transferType: TransferType.send),
),
GoRoute(
path: '/receive',
builder: (context, state) =>
TransferScreen(transferType: TransferType.receive),
builder: (_, _) => TransferScreen(transferType: TransferType.receive),
),
GoRoute(path: '/pick_apk', builder: (context, state) => ApkPickerScreen()),
GoRoute(path: '/pick_apk', builder: (_, _) => ApkPickerScreen()),
GoRoute(path: '/about', builder: (_, _) => AboutScreen()),
],
);
1 change: 1 addition & 0 deletions lib/platform/platform_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class PlatformApi {
_getAPKs();
}

/// Mobile only API
Future<pigeon.Version> getPlatformVersion() {
return _hostApi.getPlatformVersion();
}
Expand Down
45 changes: 45 additions & 0 deletions lib/screen/about_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import 'package:flutter/material.dart';
import 'package:forui/forui.dart';
import 'package:jett/utils/package_info.dart';
import 'package:url_launcher/url_launcher_string.dart';

class AboutScreen extends StatelessWidget {
const AboutScreen({super.key});

@override
Widget build(BuildContext context) {
return FScaffold(
header: FHeader.nested(
prefixes: [
FHeaderAction.x(
onPress: () {
Navigator.of(context).pop();
},
),
],
title: Text('About'),
),
child: Column(
children: [
FTileGroup(
children: [
FTile(
prefix: Icon(FIcons.code),
title: Text('Source code'),
subtitle: Text('GitHub '),
onPress: () {
launchUrlString("https://github.com/2shrestha22/jett");
},
),
FTile(
prefix: Icon(FIcons.tag),
title: Text('Version'),
subtitle: Text(PackageInfoHelper.version),
),
],
),
],
),
);
}
}
21 changes: 16 additions & 5 deletions lib/screen/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import 'dart:async';
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:forui/forui.dart';
import 'package:go_router/go_router.dart';
import 'package:jett/discovery/konst.dart';
import 'package:jett/discovery/presence.dart';
Expand All @@ -9,19 +12,17 @@ import 'package:jett/model/message.dart';
import 'package:jett/model/resource.dart';
import 'package:jett/model/transfer_status.dart';
import 'package:jett/screen/send/online_devices.dart';
import 'package:jett/widgets/picker_buttons.dart';
import 'package:jett/screen/send/presence_notifier.dart';
import 'package:jett/transfer/client.dart';
import 'package:jett/transfer/server.dart';
import 'package:jett/utils/io.dart';
import 'package:jett/utils/network.dart';
import 'package:jett/widgets/drop_region.dart';
import 'package:jett/widgets/file_view.dart';
import 'package:jett/widgets/picker_buttons.dart';
import 'package:jett/widgets/presence_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:forui/forui.dart';
import 'package:jett/widgets/safe_area.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';

import '../platform/platform_api.dart';

Expand Down Expand Up @@ -175,7 +176,17 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
@override
Widget build(BuildContext context) {
return FScaffold(
header: FHeader(title: Text(appName)),
header: FHeader(
title: Text(appName),
suffixes: [
IconButton(
onPressed: () {
context.push('/about');
},
icon: Icon(LucideIcons.info),
),
],
),
child: FSafeArea(
child: (resources.isEmpty) ? _fileEmptyView() : _fileSelectedView(),
),
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 @@ -10,6 +10,7 @@
#include <irondash_engine_context/irondash_engine_context_plugin.h>
#include <super_native_extensions/super_native_extensions_plugin.h>
#include <uri_content/uri_content_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
Expand All @@ -24,4 +25,7 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) uri_content_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UriContentPlugin");
uri_content_plugin_register_with_registrar(uri_content_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 @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
irondash_engine_context
super_native_extensions
uri_content
url_launcher_linux
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import package_info_plus
import path_provider_foundation
import super_native_extensions
import uri_content
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AccessingSecurityScopedResourcePlugin.register(with: registry.registrar(forPlugin: "AccessingSecurityScopedResourcePlugin"))
Expand All @@ -29,4 +30,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SuperNativeExtensionsPlugin.register(with: registry.registrar(forPlugin: "SuperNativeExtensionsPlugin"))
UriContentPlugin.register(with: registry.registrar(forPlugin: "UriContentPlugin"))
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 @@ -24,6 +24,8 @@ PODS:
- FlutterMacOS
- uri_content (0.0.1):
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS

DEPENDENCIES:
- accessing_security_scoped_resource (from `Flutter/ephemeral/.symlinks/plugins/accessing_security_scoped_resource/darwin`)
Expand All @@ -38,6 +40,7 @@ DEPENDENCIES:
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- super_native_extensions (from `Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos`)
- uri_content (from `Flutter/ephemeral/.symlinks/plugins/uri_content/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)

EXTERNAL SOURCES:
accessing_security_scoped_resource:
Expand All @@ -64,6 +67,8 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos
uri_content:
:path: Flutter/ephemeral/.symlinks/plugins/uri_content/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos

SPEC CHECKSUMS:
accessing_security_scoped_resource: 4a87897646efbc3a4578e28ea4c08083d7bf3e67
Expand All @@ -78,6 +83,7 @@ SPEC CHECKSUMS:
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
super_native_extensions: c2795d6d9aedf4a79fae25cb6160b71b50549189
uri_content: 6c7c098bcc83078659b4d274f42db92691eb9123
url_launcher_macos: f87a979182d112f911de6820aefddaf56ee9fbfd

PODFILE CHECKSUM: 54d867c82ac51cbd61b565781b9fada492027009

Expand Down
64 changes: 64 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.1"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8
url: "https://pub.dev"
source: hosted
version: "6.3.2"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "5c8b6c2d89a78f5a1cca70a73d9d5f86c701b36b42f9c9dac7bad592113c28e9"
url: "https://pub.dev"
source: hosted
version: "6.3.24"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "6b63f1441e4f653ae799166a72b50b1767321ecc263a57aadf825a7a2a5477d9"
url: "https://pub.dev"
source: hosted
version: "6.3.5"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935"
url: "https://pub.dev"
source: hosted
version: "3.2.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: "8262208506252a3ed4ff5c0dc1e973d2c0e0ef337d0a074d35634da5d44397c9"
url: "https://pub.dev"
source: hosted
version: "3.2.4"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2"
url: "https://pub.dev"
source: hosted
version: "2.4.1"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77"
url: "https://pub.dev"
source: hosted
version: "3.1.4"
uuid:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+2
version: 1.0.1+3
environment:
sdk: ^3.8.1
flutter: 3.35.6
Expand Down Expand Up @@ -54,6 +54,7 @@ dependencies:
flutter_hooks: ^0.21.3+1
super_drag_and_drop: ^0.9.1
go_router: ^16.2.4
url_launcher: ^6.3.2
dev_dependencies:
flutter_test:
sdk: flutter
Expand Down
3 changes: 3 additions & 0 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <irondash_engine_context/irondash_engine_context_plugin_c_api.h>
#include <super_native_extensions/super_native_extensions_plugin_c_api.h>
#include <uri_content/uri_content_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
FileSelectorWindowsRegisterWithRegistrar(
Expand All @@ -20,4 +21,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("SuperNativeExtensionsPluginCApi"));
UriContentPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UriContentPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
1 change: 1 addition & 0 deletions windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
irondash_engine_context
super_native_extensions
uri_content
url_launcher_windows
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down