Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/providers/fvm_cache.provider.dart
  • Loading branch information
leoafarias committed May 6, 2021
2 parents f878454 + 50ecd14 commit e08e1be
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 65 deletions.
34 changes: 34 additions & 0 deletions INSTALLING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Installing Sidekick is super simple and should only take a few minutes! To start of, [download the latest release](https://github.com/leoafarias/sidekick/releases/latest) or build from source (Like any other flutter application).

# Windows
There are two ways to install Sidekick on Windows. Firstly, with an MSIX, named `Sidekick-windows-x.x.x.msix`, you should run this if you wish to install Sidekick on you PC, please check Installing with MSIX for instructions. Alternatively, you can just run `Sidekick.exe` to use Sidekick without having to install anything. This is done by downloading `windows-x.x.x.zip`

### Installing with MSIX (Recommended)
Unfortunately, it isn't as easy as opening the file and installing it as we do not have a signed certificate (yet).

To install Sidekick, first right-click and click on `Properties`.

Then, navigate to `Digital Signatures`. You will see only one signature called `Msix Testing`, you will need to add this to the windows key-store. To do this, please double-click on the signature and click on `View Certificate`. Next, click on `Install Certificate` and then on `Local System`. Finally you'll need to select they key-store called `Trusted Root Certification Authorities` under `Browse`.

After completing those steps you should now be able to install Sidekick using the MSIX package.

### Using the portable version
If you don't wish to install an untrusted certificate you can also simply save `Sidekick.exe` and all of the other files wherever you want and then create a desktop shortcut. Please note that the auto-update feature will not work!

# MacOS
In order to install Sidekick on MacOS we recommend downlading the file named `Sidekick-macos-x.x.x.dmg`, you should run this if you wish to install Sidekick on you Mac, please check Installing with DMG for instructions. Alternatively, you can just run `Sidekick` to use Sidekick without having to install anything by downloading `macos-x.x.x.zip`.

### Installing with DMG (Recommended)
To install Sidekick in your Mac simply open `Sidekick.dmg` and drag the Sidekick app to the `Applications` folder next to it. If you are updating the app you'll need to click `Replace`.

After doing this you should be able to see `Sidekick` in your Laucnhapd. However, if you try to open it you might get a message saying that `"Sidekick" can't be opened because Apple cannot check it for malicious software.` In order to fix this open `System Preferences` and click on `Security and Privacy`, where you'll see a message saying `"Sidekick" was blocked from use because it is not from an identified developer`, in order to complete the installation you will need to click `Open Anyway` and then `Open` in the popup.

Done! You should now be able to use Sidekick normally!

### Using the portable version
To use the portable version of Sidekick in your Mac simply locate `Sidekick` and drag the it wherever you want to store the app.

After doing this you should be able to open `Sidekick`. However, if you try to open it you might get a message saying that `"Sidekick" can't be opened because Apple cannot check it for malicious software.` In order to fix this open `System Preferences` and click on `Security and Privacy`, where you'll see a message saying `"Sidekick" was blocked from use because it is not from an identified developer`, in order to complete the installation you will need to click `Open Anyway` and then `Open` in the popup.

# Linux
Coming soon!
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/leoafarias/sidekick?color=FFB82E&label=Release&style=for-the-badge)
![Github All Contributors](https://img.shields.io/github/all-contributors/leoafarias/sidekick?color=FF5B2E&label=All%20contributors&style=for-the-badge)
![GitHub](https://img.shields.io/github/license/leoafarias/sidekick?color=442EFF&label=License&style=for-the-badge)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/leoafarias/sidekick?color=FFB82E&label=Release&style=for-the-badge)](https://github.com/leoafarias/sidekick/releases/latest)
[![Github All Contributors](https://img.shields.io/github/all-contributors/leoafarias/sidekick?color=FF5B2E&label=All%20contributors&style=for-the-badge)](https://github.com/leoafarias/sidekick#contributors-)
[![GitHub](https://img.shields.io/github/license/leoafarias/sidekick?color=442EFF&label=License&style=for-the-badge)](https://github.com/leoafarias/sidekick/blob/main/LICENSE.md)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

Sidekick is an app that provides a simple desktop interface to tools that enhance Flutter development experience to make it even more delightful.

[![Download Sidekick](https://github.com/leoafarias/sidekick/blob/main/assets/download-banner.png?raw=true)](https://github.com/leoafarias/sidekick/releases)
[![Download Sidekick](https://github.com/leoafarias/sidekick/blob/main/assets/download-banner.png?raw=true)](https://github.com/leoafarias/sidekick/releases/latest)

![Sidekick Screenshot](https://github.com/leoafarias/sidekick/blob/main/assets/screenshot.png?raw=true)

## ![Installation Instructions](https://github.com/leoafarias/sidekick/blob/main/INSTALLING.md)

## Features

- Manage Flutter versions
- Explore releases
- View most used packages
Expand Down
6 changes: 4 additions & 2 deletions lib/components/atoms/empty_data_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ class EmptyDataSet extends StatelessWidget {

const EmptyDataSet({
this.icon,
this.iconColor = Colors.white,
this.iconColor,
this.backgroundColor = Colors.black,
this.child,
});

@override
Widget build(BuildContext context) {
final bgIcons = _buildIconsBackground(icon: icon, color: iconColor);
final bgIcons = _buildIconsBackground(
icon: icon,
color: iconColor ?? Theme.of(context).textTheme.bodyText1.color);

return Stack(
children: [
Expand Down
11 changes: 10 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:oktoast/oktoast.dart';
import 'package:sidekick/app_shell.dart';
import 'package:sidekick/constants.dart';
import 'package:sidekick/dto/settings.dto.dart';
import 'package:sidekick/screens/error_db_screen.dart';
import 'package:sidekick/services/settings_service.dart';
import 'package:sidekick/theme.dart';
import 'package:sidekick/utils/get_theme_mode.dart';
Expand All @@ -18,7 +19,11 @@ void main() async {
Hive.registerAdapter(SidekickSettingsAdapter());
await Hive.initFlutter();

await SettingsService.init();
try {
await SettingsService.init();
} on FileSystemException {
print("There was an issue opening the DB");
}

if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
setWindowTitle(kAppTitle);
Expand All @@ -32,6 +37,10 @@ void main() async {
class FvmApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (SettingsService.box == null) {
return const ErrorDBScreen();
}

return ValueListenableBuilder(
valueListenable: SettingsService.box.listenable(),
builder: (context, box, widget) {
Expand Down
7 changes: 6 additions & 1 deletion lib/providers/flutter_releases.provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ class AppReleasesState {
List<ChannelDto> channels;
List<VersionDto> versions;
Map<String, ReleaseDto> allMap;
bool hasGlobal;
AppReleasesState({
this.channels,
this.versions,
this.master,
this.allMap,
this.hasGlobal = false,
}) {
channels = <ChannelDto>[];
versions = <VersionDto>[];
Expand All @@ -27,6 +29,7 @@ class AppReleasesState {
List<ReleaseDto> get all {
final releases = [...channels, ...versions];
if (master != null) {
// Master goes first
releases.insert(0, master);
}

Expand Down Expand Up @@ -54,7 +57,6 @@ final releasesStateProvider = Provider<AppReleasesState>((ref) {
FlutterReleases payload;
ref.watch(_fetchFlutterReleases).whenData((value) => payload = value);
final installedVersions = ref.watch(fvmCacheProvider.notifier);
final globalVersion = FVMClient.getGlobalVersionSync();

// Watch this state change for refresh
ref.watch(fvmCacheProvider);
Expand All @@ -73,6 +75,9 @@ final releasesStateProvider = Provider<AppReleasesState>((ref) {
return releasesState;
}

final globalVersion = FVMClient.getGlobalVersionSync();
releasesState.hasGlobal = globalVersion != null;

// MASTER: Set Master separetely because workflow is very different
final masterCache = installedVersions.getChannel(kMasterChannel);
String masterVersion;
Expand Down
63 changes: 63 additions & 0 deletions lib/screens/error_db_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import 'dart:io';

import 'package:flutter/material.dart';

class ErrorDBScreen extends StatelessWidget {
const ErrorDBScreen({Key key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Container(
child: MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.grey,
body: Center(
child: Container(
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
),
constraints: const BoxConstraints(maxWidth: 700, maxHeight: 300),
margin: const EdgeInsets.all(10),
padding: const EdgeInsets.all(30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Text(
"There was an isssue opening Sidekick",
style: Theme.of(context).textTheme.headline4,
textAlign: TextAlign.center,
),
const SizedBox(
height: 20,
),
const Text(
text,
textAlign: TextAlign.center,
),
const SizedBox(
height: 20,
),
ElevatedButton.icon(
label: const Text("Close"),
icon: const Icon(Icons.close),
onPressed: () {
exit(0);
},
)
],
),
),
),
),
),
);
}
}

const text = "Sidekick is having trouble reading its settings."
" Please make sure that there are no other instances of Sidekick running"
" and try again. If the problem persists, please open a Github Issue.";
153 changes: 99 additions & 54 deletions lib/screens/settings_scenes/settings_section_flutter.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:sidekick/components/atoms/typography.dart';
import 'package:sidekick/providers/flutter_releases.provider.dart';
import 'package:sidekick/providers/settings.provider.dart';

class SettingsSectionFlutter extends StatelessWidget {
class SettingsSectionFlutter extends HookWidget {
final Settings settings;
final Function() onSave;

Expand All @@ -14,62 +18,103 @@ class SettingsSectionFlutter extends StatelessWidget {

@override
Widget build(BuildContext context) {
final releases = useProvider(releasesStateProvider);

final deactivate = !releases.hasGlobal;

return Container(
padding: const EdgeInsets.only(top: 20),
child: ListView(
children: [
Text('Flutter', style: Theme.of(context).textTheme.headline6),
const SizedBox(height: 20),
SwitchListTile(
title: const Text('Analytics & Crash Reporting'),
subtitle: const Text("When a flutter command crashes it attempts"
child: CupertinoScrollbar(
child: ListView(
children: [
Text('Flutter', style: Theme.of(context).textTheme.headline6),
const SizedBox(height: 20),
releases.hasGlobal
? Container()
: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// TODO: Move this into a separate component
Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.deepOrange.withOpacity(0.1),
border: Border.all(
color: Colors.deepOrange,
width: 0.5,
),
),
child: const Text(
'A Flutter sdk version neeeds to be set as global '
'in order to access Flutter settings',
),
),
const SizedBox(height: 20)
],
),
SwitchListTile(
title: const Text('Analytics & Crash Reporting'),
subtitle: const Text(
"When a flutter command crashes it attempts"
" to send a crash report to Google in order to help"
" Google contribute improvements to Flutter over time"),
value: !settings.flutter.analytics,
onChanged: (value) {
settings.flutter.analytics = !value;
onSave();
},
),
const SizedBox(height: 20),
const Subheading('Platforms'),
const SizedBox(height: 20),
SwitchListTile(
title: const Text('Web'),
value: settings.flutter.web,
onChanged: (value) {
settings.flutter.web = value;
onSave();
},
),
const Divider(),
SwitchListTile(
title: const Text('MacOS'),
value: settings.flutter.macos,
onChanged: (value) {
settings.flutter.macos = value;
onSave();
},
),
const Divider(),
SwitchListTile(
title: const Text('Windows'),
value: settings.flutter.windows,
onChanged: (value) {
settings.flutter.windows = value;
onSave();
},
),
const Divider(),
SwitchListTile(
title: const Text('Linux'),
value: settings.flutter.linux,
onChanged: (value) {
settings.flutter.linux = value;
onSave();
},
),
],
" Google contribute improvements to Flutter over time",
),
value: !settings.flutter.analytics,
onChanged: deactivate
? null
: (value) {
settings.flutter.analytics = !value;
onSave();
},
),
const SizedBox(height: 20),
const Subheading('Platforms'),
const SizedBox(height: 20),
SwitchListTile(
title: const Text('Web'),
value: settings.flutter.web,
onChanged: deactivate
? null
: (value) {
settings.flutter.web = value;
onSave();
},
),
const Divider(),
SwitchListTile(
title: const Text('MacOS'),
value: settings.flutter.macos,
onChanged: deactivate
? null
: (value) {
settings.flutter.macos = value;
onSave();
},
),
const Divider(),
SwitchListTile(
title: const Text('Windows'),
value: settings.flutter.windows,
onChanged: deactivate
? null
: (value) {
settings.flutter.windows = value;
onSave();
},
),
const Divider(),
SwitchListTile(
title: const Text('Linux'),
value: settings.flutter.linux,
onChanged: deactivate
? null
: (value) {
settings.flutter.linux = value;
onSave();
},
),
],
),
),
);
}
Expand Down
Loading

0 comments on commit e08e1be

Please sign in to comment.