Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running on MAC and Windows #18

Closed
joeblew99 opened this issue Aug 1, 2019 · 6 comments
Closed

Running on MAC and Windows #18

joeblew99 opened this issue Aug 1, 2019 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@joeblew99
Copy link

Can someone let me know if this is useful.

I was curious what the UX experience is to run it on a Desktop.
Its actually very useful, because you can run it in full screen, and just use the apps and forget about the real desktop behind it.

also its quick for working on the app because go-flutter has hot reload.

I only had to make minor mods to the main.dart file and add a main_desktop.dart file and break out the "MyApp" class to a new file called mainapp.dart, and get the new main.dart and main_desktop.dart to call it.

https://www.youtube.com/watch?v=epoNDPnGjU0&feature=youtu.be

  • its funny how the Text Editor gets a bit confused when i try to select text.

Makefile:

# https://github.com/dahlia-os/pangolin-desktop

# The main dev
# nmcain@gmail.com

# wow it works on Mobiles

LIB_NAME=pangolin-desktop
LIB=github.com/dahlia-os/$(LIB_NAME)
LIB_BRANCH=master
LIB_FSPATH=$(GOPATH)/src/$(LIB)

print:
	@echo $(LIB_NAME)
	@echo $(LIB)
	@echo $(LIB_BRANCH)
	@echo $(LIB_FSPATH)

dep:
	# git clone
	mkdir -p $(LIB_FSPATH)
	cd $(LIB_FSPATH) && cd .. && rm -rf $(NAME) && git clone https://$(LIB).git
	cd $(LIB_FSPATH) && git checkout $(LIB_BRANCH)
dep-clean:
	rm -rf $(LIB_FSPATH)
code:
	code $(LIB_FSPATH)
flu-dep:
	cd $(LIB_FSPATH) && flutter packages get
hov-dep:
	go get -u github.com/go-flutter-desktop/hover
	go get -u github.com/go-flutter-desktop/go-flutter

mob-run:
	cd $(LIB_FSPATH) && flutter run -d all
desk-init:
	# need to manually fix main.dart first DONE
	cd $(LIB_FSPATH) && hover init $(LIB)
desk-init-clean:
	rm -rf $(LIB_FSPATH)/desktop
desk-buildrun:
	cd $(LIB_FSPATH) && hover build
	open $(LIB_FSPATH)/desktop/build/outputs/darwin/Pangolin
desk-run:
	cd $(LIB_FSPATH) && hover run



@joeblew99
Copy link
Author

TO get it to work i only had to make these changes.
Because the main.dart is essentially the same, you can run this.

main_desktop.dart:


import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'mainapp.dart';

void main() {
  debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
  runApp(MainApp());
}


main.dart:



//import 'dart:async';
import 'package:flutter/material.dart';
//import 'package:intl/intl.dart';
import 'mainapp.dart';

void main() => runApp(MainApp());












mainapp.dart:


import 'window_space.dart';
//import 'dart:async';
import 'package:flutter/material.dart';
//import 'package:intl/intl.dart';
import 'menu.dart';
import 'package:flutter/services.dart';
import 'widgets/system_overlay.dart';
import 'quick_settings.dart';
import 'widgets/toggle.dart';
import 'launcher_toggle.dart';
import 'status_tray.dart';
import 'app_toggle.dart';
import 'launcher.dart';


class MainApp extends StatelessWidget {
  @override

....

@nmcain
Copy link
Member

nmcain commented Aug 1, 2019 via email

@nmcain
Copy link
Member

nmcain commented Aug 2, 2019

You can create a pull request, but we are not focusing on desktop embedders, we are focusing on an actual Dahlia system.

@carbonatedcaffeine carbonatedcaffeine added the enhancement New feature or request label Aug 7, 2019
@carbonatedcaffeine carbonatedcaffeine pinned this issue Aug 7, 2019
@nmcain
Copy link
Member

nmcain commented Oct 30, 2019

Could you either create a pull request and have it work on linux rather than macOS?

@joeblew99
Copy link
Author

@nmcain I dont have time as working on another project where we use go-flutter to make flutter apps that run on all desktops and web.

https://github.com/winwisely99/main

SO rather than me make a PR, you only need to follow the make file i made above.
It builds for all desktops and mobiles, and the build happens inside docker.

hover is the CLI in golang that does it all
https://github.com/go-flutter-desktop/hover

chat with team
https://gitter.im/go-flutter-desktop/go-flutter

@nmcain
Copy link
Member

nmcain commented May 25, 2020

We have officially added desktop platform support as of now for Linux based builds, and on MacOS, windows and Web. Thank you!

@nmcain nmcain closed this as completed May 25, 2020
@SincerelyFaust SincerelyFaust unpinned this issue Sep 18, 2020
@SincerelyFaust SincerelyFaust pinned this issue Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants