Skip to content

Commit

Permalink
🚀 v1.0.0+6 released.
Browse files Browse the repository at this point in the history
V1.0.0+6 source
  • Loading branch information
omegaui authored Oct 19, 2023
2 parents 74ce86e + 5021265 commit 6955728
Show file tree
Hide file tree
Showing 35 changed files with 543 additions and 221 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## v1.0.0+6

- **NEW** Dark Theme
- **NEW** LAF of the entire app
- App Picker Dialog can be optionally kept open.
- Reload Manager from Disk
- Pretty Write Configurations
- Option to keep launcher Alive After Workspace Launch
- Option to specify which workspace should be switched to after launch completes.

## v1.0.0+5

- Added App Support Method (Buy Me a Coffee).
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ Here comes App Fleet,
If you have really liked the project and want to support the development of App Fleet.
Then, please consider buying me a coffee.

<div>
<img src="github/images/qr-code.png" alt="GitHub Banner" width="350">
</div>
It helps me to work on the project in my free time.

Scan this Qr Code or <br>
Scan this [**Qr Code**](github/images/qr-code.png) or <br>

Click the button below to Buy Me a Coffee.

Expand Down
10 changes: 5 additions & 5 deletions assets/themes/dark.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"background": "0xFF191A1E",
"foreground": "0xFFFFFFFF",
"window-drop-shadow": "0x661E1E1E",
"dialog-drop-shadow": "0x1A9E9E9E",
"dialog-drop-shadow": "0x66000000",
"create-button-border-color": "0xFF448AFF",
"create-button-background": "0x33448AFF",
"create-button-foreground": "0xFF2196F3",
Expand Down Expand Up @@ -30,13 +30,13 @@
"app-tile-foreground": "0xFFFFFFFF",
"app-tile-background": "0xFF9E9E9E",
"app-workspace-indicator-foreground": "0xFFFFFFFF",
"app-workspace-indicator-background": "0xFF69F0AE",
"app-workspace-indicator-background": "0xFF305EAD",
"selected-workspace-indicator-foreground": "0xFFFFFFFF",
"selected-workspace-indicator-background": "0xFF69F0AE",
"selected-workspace-indicator-background": "0xFF47A376",
"unselected-workspace-indicator-foreground": "0xFFFFFFFF",
"unselected-workspace-indicator-background": "0xFF448AFF",
"unselected-workspace-indicator-background": "0xFF305EAD",
"workspace-dialog-background": "0xFF1E1E1E",
"workspace-dialog-drop-shadow-color": "0x669E9E9E",
"workspace-dialog-drop-shadow-color": "0x66000000",
"config-label-foreground": "0xFFB9B9B9",
"config-label-background": "0xFF2E2E2E",
"save-label-background": "0xFF448AFF",
Expand Down
21 changes: 17 additions & 4 deletions lib/app/config/domain/workspace_entity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,33 @@ import 'package:app_fleet/utils/utils.dart';
class WorkspaceEntity {
late String name;
late String iconPath;
Set<App> apps = {};
int defaultWorkspace; // Since v1.0.0+6
Set<App> apps;

WorkspaceEntity({
required this.name,
required this.iconPath,
int? defaultWorkspace,
Set<App>? applications,
}) : apps = applications ?? {};
}) : apps = applications ?? {},
defaultWorkspace = defaultWorkspace ?? -1;

WorkspaceEntity.clone(
WorkspaceEntity entity, {
String? name,
String? iconPath,
int? defaultWorkspace,
Set<App>? applications,
}) : name = name ?? entity.name,
iconPath = iconPath ?? entity.iconPath,
defaultWorkspace = defaultWorkspace ?? entity.defaultWorkspace,
apps = (applications != null ? {...applications} : {...entity.apps});

Map<String, dynamic> toMap() {
return {
StorageKeys.nameKey: name,
StorageKeys.iconPathKey: iconPath,
StorageKeys.defaultWorkspaceKey: defaultWorkspace,
StorageKeys.appsKey: apps.map((e) => e.toMap()).toList(),
};
}
Expand All @@ -47,6 +53,7 @@ class WorkspaceEntity {
return WorkspaceEntity(
name: data[StorageKeys.nameKey],
iconPath: data[StorageKeys.iconPathKey],
defaultWorkspace: data[StorageKeys.defaultWorkspaceKey],
applications: apps.toSet(),
);
}
Expand All @@ -55,7 +62,9 @@ class WorkspaceEntity {
bool operator ==(Object other) {
if (other.runtimeType == WorkspaceEntity) {
other = other as WorkspaceEntity;
if (name == other.name && iconPath == other.iconPath) {
if (name == other.name &&
iconPath == other.iconPath &&
defaultWorkspace == other.defaultWorkspace) {
if (apps.length != other.apps.length) {
return false;
}
Expand All @@ -76,7 +85,11 @@ class WorkspaceEntity {

@override
int get hashCode =>
super.hashCode ^ name.hashCode ^ iconPath.hashCode ^ apps.hashCode;
super.hashCode ^
name.hashCode ^
iconPath.hashCode ^
defaultWorkspace.hashCode ^
apps.hashCode;
}

class App {
Expand Down
7 changes: 7 additions & 0 deletions lib/app/config/presentation/config_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:app_fleet/app/config/presentation/config_state_machine.dart';
import 'package:app_fleet/constants/request_status.dart';
import 'package:app_fleet/core/dependency_manager.dart';
import 'package:app_fleet/core/route_service.dart';
import 'package:app_fleet/utils/utils.dart';
import 'package:url_launcher/url_launcher_string.dart';

class ConfigController {
final VoidCallback _onRebuildRequested;
Expand Down Expand Up @@ -34,6 +36,11 @@ class ConfigController {
}
}

void openInDesktop(WorkspaceEntity workspaceEntity) {
launchUrlString(getWorkspacePath(workspaceEntity.name));
gotoHomeRoute();
}

void onEvent(ConfigEvent event) {
switch (event.runtimeType) {
case ConfigInitializationEvent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:app_fleet/utils/bottom_bar.dart';
import 'package:app_fleet/utils/show_app_selection_dialog.dart';
import 'package:app_fleet/utils/show_confirm_delete_dialog.dart';
import 'package:app_fleet/utils/show_discard_edits_dialog.dart';
import 'package:app_fleet/utils/snack_bar_builder.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';

Expand Down Expand Up @@ -77,7 +78,7 @@ class _ConfigInitializedStateViewState
const CharacterActivator('f', control: true): () {
showAppSelectionDialog(
context: context,
onClose: (app) {
onClick: (app) {
setState(
() {
if (app != null) {
Expand Down Expand Up @@ -175,7 +176,33 @@ class _ConfigInitializedStateViewState
if (widget.configUIMode ==
ConfigUIMode.edit)
AppTooltipBuilder.wrap(
text: "Mark as Default Workspace",
text: "Edit in your system",
child: IconButton(
onPressed: () {
showSnackbar(
icon: Icon(
Icons.info,
color: AppTheme.foreground,
),
message:
"Opening Config in your system ...");
widget.controller.openInDesktop(
widget.workspaceEntity);
},
icon: const Icon(
Icons.open_in_new_rounded,
color: Colors.grey,
size: 22,
),
).animate().scale(
delay:
const Duration(seconds: 1)),
),
if (widget.configUIMode ==
ConfigUIMode.edit)
AppTooltipBuilder.wrap(
text:
"Execute this workspace on Startup",
child: IconButton(
onPressed: () {
setState(() {
Expand Down
2 changes: 1 addition & 1 deletion lib/app/config/presentation/widgets/workspace_app_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class _WorkspaceAppBoxState extends State<WorkspaceAppBox> {
onPressed: () {
showAppSelectionDialog(
context: context,
onClose: (app) {
onClick: (app) {
setState(
() {
if (app != null) {
Expand Down
10 changes: 10 additions & 0 deletions lib/app/home/presentation/states/home_initialized_state_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ class _HomeInitializedStateViewState extends State<HomeInitializedStateView> {
@override
void initState() {
super.initState();
onUpdate();
}

@override
void didUpdateWidget(covariant HomeInitializedStateView oldWidget) {
super.didUpdateWidget(oldWidget);
onUpdate();
}

void onUpdate() {
workspaces = widget.controller.getWorkspaces();
}

Expand Down
13 changes: 9 additions & 4 deletions lib/app/home/presentation/widgets/workspace_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ class _WorkspaceTileState extends State<WorkspaceTile> {
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: accentColorMap[
widget.workspaceEntity.name[0].toUpperCase()]!
color: (AppTheme.isDarkMode()
? AppTheme.dialogDropShadow
: accentColorMap[
getAccentChar(widget.workspaceEntity.name)
.toUpperCase()]!)
.withOpacity(hover ? 0.6 : 0.2),
blurRadius: 16,
)
),
],
),
child: Center(
Expand Down Expand Up @@ -160,7 +163,9 @@ class _WorkspaceTileState extends State<WorkspaceTile> {
scale: hover ? 0.8 : 1.0,
child: Container(
decoration: BoxDecoration(
color: accentColorMap[widget.workspaceEntity.name[0]] ??
color: accentColorMap[
getAccentChar(widget.workspaceEntity.name)
.toUpperCase()] ??
Colors.amber.shade700,
borderRadius: BorderRadius.circular(20),
boxShadow: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import 'package:app_fleet/main.dart';
import 'package:app_fleet/utils/app_tooltip_builder.dart';
import 'package:app_fleet/utils/app_window_buttons.dart';
import 'package:app_fleet/utils/bottom_bar.dart';
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:lottie/lottie.dart';

class LauncherEmptyStateView extends StatefulWidget {
Expand Down Expand Up @@ -114,6 +116,8 @@ class _LauncherEmptyStateViewState extends State<LauncherEmptyStateView> {
child: appWindowButton(
color: Colors.red,
onPressed: () {
appWindow.close();
SystemNavigator.pop();
Navigator.pop(context);
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,36 +113,50 @@ class _LauncherInitializedStateViewState
child: MouseRegion(
onEnter: (e) => setContentState(() => hover = true),
onExit: (e) => setContentState(() => hover = false),
child: AppTooltipBuilder.wrap(
text: workspaceEntity.name,
child: AnimatedContainer(
duration: const Duration(milliseconds: 250),
width: 80,
height: 80,
padding: const EdgeInsets.all(16.0),
margin: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: AppTheme.background,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: accentColorMap[
workspaceEntity.name[0].toUpperCase()]!
.withOpacity(hover ? 0.6 : 0.2),
blurRadius: 16,
)
],
),
child: Center(
child: AnimatedScale(
duration: const Duration(milliseconds: 500),
scale: hover ? 0.8 : 1.0,
child: getWorkspaceIcon(
workspaceEntity.iconPath,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
AnimatedContainer(
duration: const Duration(milliseconds: 250),
width: 80,
height: 80,
padding: const EdgeInsets.all(16.0),
margin: EdgeInsets.only(
top: 16.0,
bottom: hover ? 6.0 : 16.0,
right: 16.0,
left: 16.0,
),
decoration: BoxDecoration(
color: AppTheme.background,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: (AppTheme.isDarkMode()
? AppTheme.dialogDropShadow
: accentColorMap[
getAccentChar(workspaceEntity.name)
.toUpperCase()]!)
.withOpacity(hover ? 0.6 : 0.2),
blurRadius: 16,
)
],
),
child: Center(
child: AnimatedScale(
duration: const Duration(milliseconds: 500),
scale: hover ? 0.8 : 1.0,
child: getWorkspaceIcon(
workspaceEntity.iconPath,
),
),
),
),
),
Text(
workspaceEntity.name,
style: AppTheme.fontSize(12).makeBold(),
),
],
),
),
);
Expand Down Expand Up @@ -230,12 +244,17 @@ class _LauncherInitializedStateViewState
),
if (launchStatus != null)
Align(
alignment: Alignment.bottomCenter,
alignment: Alignment.topCenter,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
launchStatus!,
style: AppTheme.fontSize(14).makeBold(),
child: SizedBox(
width: 300,
child: Text(
launchStatus!,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: AppTheme.fontSize(13),
),
),
),
),
Expand Down
16 changes: 16 additions & 0 deletions lib/app/settings/data/settings_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ import 'package:http/http.dart';
class SettingsRepository {
final storage = DependencyInjection.find<AppConfiguration>();

void setKeepAppPickerOpen(bool value) {
storage.put('keep-app-picker-open', value);
}

bool getKeepAppPickerOpen() {
return storage.get('keep-app-picker-open') ?? false;
}

void setKeepAliveLauncher(bool value) {
storage.put('keep-alive-launcher', value);
}

bool getKeepAliveLauncher() {
return storage.get('keep-alive-launcher') ?? false;
}

void setDefaultWorkspace(String? name) {
storage.put('default-workspace', name);
}
Expand Down
Loading

0 comments on commit 6955728

Please sign in to comment.