Closed ghost closed 4 years ago
Thanks for your feedback!
I'm already building Telephant for Android just fine. iOS should work as well in theory, but I'm not sure I can be bothered to support that platform. I'm not quite convinced by Flutter just yet, but am happy to learn more about it.
I'm struggling to find any good desktop examples apps. Which toolkits & platforms does it support?
not sure what you mean about platforms and toolkits. Flutter provides all of it.
here is a make file that shows the basics of running on All Mobiles and Desktops.
You need to install flutter first. I cheat and us this golang cli to do it :) https://github.com/leoafarias/fvm like nodeversion manager but for flutter.
Here is a cool example to show off how powerful Flutter is. You should be able to follow my crusty Makefile style.... Its a bit old, but should still work.
I will try to put up some better stuff on github...
# https://github.com/memspace/zefyr
NAME=zefyr
BRANCH=master
LIB=github.com/memspace/$(NAME)
LIB_FSPATH=$(GOPATH)/src/$(LIB)
EX_NAME=example
EX_GOPATH=$(LIB)/packages/zefyr/$(EX_NAME)
EX_FSPATH=$(GOPATH)/src/$(EX_GOPATH)
print:
@echo
@echo NAME : $(NAME)
@echo BRANCH : $(BRANCH)
@echo LIB : $(LIB)
@echo LIB_FSPATH : $(LIB_FSPATH)
#ls -al $(LIB_FSPATH)
@echo
@echo EX_NAME : $(EX_NAME)
@echo EX_GOPATH : $(EX_GOPATH)
@echo EX_FSPATH : $(EX_FSPATH)
dep-all: dep-os dep dep-modules
# get all deps
dep-os:
go get -u github.com/go-flutter-desktop/hover
# dev tools
go get github.com/cortesi/devd/cmd/devd
dep:
## install on gopath
mkdir -p $(LIB_FSPATH)
cd $(LIB_FSPATH) && cd .. && rm -rf $(NAME) && git clone https://$(LIB).git
# THIS IS WHERE THE CODE IS.
cd $(LIB_FSPATH) && git checkout $(BRANCH)
dep-status:
cd $(LIB_FSPATH) && git status
dep-modules:
cd $(LIB_FSPATH) && flutter packages get
code:
cd $(LIB_FSPATH) && code .
clean:
# gopath
rm -rf $(LIB_FSPATH)
### Build
qlog:
# for debugging...
tail -f $(TMPDIR)/q
go-run:
cd $(LIB_FSPATH)/go-server/cmd/server && go run main.go
inject-appbar:
# App Bar Logo
#code --goto $(EX_FSPATH)/lib/src/full_page.dart:14
inject-icon:
# Mobile App Icon
# https://dev.to/rkowase/how-to-generate-flutter-app-icons-for-ios-and-android-11gc
code --goto $(EX_FSPATH)/pubspec.yaml:27
mkdir -p $(EX_FSPATH)/icon
cp ./../logo.png $(EX_FSPATH)/icon/icon.png
cd $(EX_FSPATH) && flutter pub get
cd $(EX_FSPATH) && flutter pub pub run flutter_launcher_icons:main
inject:
# Text (zefyr --> RTEditor)
#code --goto $(EX_FSPATH)/lib/src/full_page.dart:26
# Text (zefyr --> RTEditor)
#code --goto $(EX_FSPATH)/lib/src/view.dart:14
flu-mob-build:
# takes ages !!!!
# TODO: Sign and deployment automation.
# android- works !
cd $(EX_FSPATH) && flutter -v build apk
# ios - works !
cd $(EX_FSPATH) && flutter -v build ios
flu-mob-run:
# NOTE ! For Real Android or IOS device, you have to do a build first if you have never done one.
# DONT run andooid emulator - its too slow
# Androids
#flutter emulators --launch Pixel_2_API_28
#flutter emulators --launch Nexus 5X
# any apple device
flutter emulators --launch apple_ios_simulator
cd $(EX_FSPATH) && flutter run -d all
flu-desk-init:
# Add Desktop stuff to it.
cd $(EX_FSPATH) && hover init $(EX_GOPATH)
## Copy main_desktop
#cp main_desktop.dart $(HOV_EX_FSPATH)/hover01/lib
# Desktop App Icon
cp ./../logo.png $(EX_FSPATH)/desktop/assets/logo.png
flu-desk-init-clean:
# Destroy desktop
rm -rf $(EX_FSPATH)/desktop
flu-desk-build:
# build the Desktop app.
#cd $(EX_FSPATH) && hover build ./desktop/build/outputs/darwin/$(EX_NAME)
cd $(EX_FSPATH) && hover build --target $(EX_FSPATH)/lib/main.dart
flu-desk-run:
# run must be run from the dir where the exe is!
cd $(EX_FSPATH)/desktop/build/outputs/darwin && ./$(EX_NAME)
flu-desk-runhot:
cd $(EX_FSPATH) && hover run --target $(EX_FSPATH)/lib/main.dart
flu-desk-pack:
# just zip the folder
# later do proper Mac packaging.. Still working that out.
I'm sorry, but I don't think I'll make the switch to an entirely new toolkit at this point. If anything, that would be a completely new app with its own repository. Thank you for the suggestions, though!
I used to use golang with QT but changed to using Flutter with golang. Why ? All Desktops and Mobiles from the SAME codebase. Much easier going forward because there are so many plugins for Flutter. There is really NOTHING to change between Mobile and Desktop.
You are aware that Qt is cross-platform, too? And suppport even much more platforms than flutter? This "Use flutter" thing is the next bulls**t after RiR. I can be useful sometimes to use flutter, but there is no reason why flutter is better than Qt.
Edit: Sorry for intervening this, seems like the issue opener only created his account to troll.
I used to use golang with QT but changed to using Flutter with golang. Why ? All Desktops and Mobiles from the SAME codebase. Much easier going forward because there are so many plugins for Flutter. There is really NOTHING to change between Mobile and Desktop. If the Mobile uses a plugin that relies on a swift or java lib, you can easily support the plugin for Desktop too because the API is identical, and because for Desktop you write the plugin in golang its normally easy to support. For a Great example of this look at PDF and Printing, which is really hard normally. Fluttter Widgets can output to PDF (https://github.com/DavBfr/dart_pdf) . SO you can print on Mobile and Desktop. But the Printer API varies. But you can easily support this on Desktop by just writing a bit of CGO code for desktops and your done.
I would really be interested in adapting the current code for Flutter if the team want it.
The Flutter Desktop system: https://github.com/go-flutter-desktop/go-flutter
The only change is to add a main_desktop.dart.