DEV Community

Rody Davis
Rody Davis

Posted on • Originally published at rodydavis.com on

Flutter Cheat Sheet — Terminal

Run Flutter web with SKIA

flutter run -d web --release --dart-define=FLUTTER_WEB_USE_SKIA=true
Enter fullscreen mode Exit fullscreen mode
  • Run Flutter web with Canvas Kit
flutter run -d chrome --release --dart-define=FLUTTER_WEB_USE_EXPERIMENTAL_CANVAS_TEXT=true
Enter fullscreen mode Exit fullscreen mode
  • Build your Flutter web app to Github Pages to the docs folder
flutter build web && rm -rf ./docs && mkdir ./docs && cp -a ./build/web/. ./docs/
Enter fullscreen mode Exit fullscreen mode
  • Clean rebuild CocoaPods
cd ios && pod deintegrate && pod cache clean —all && pod install && cd ..
Enter fullscreen mode Exit fullscreen mode

Sometimes with firebase you need to run: pod update Firebase

  • Create Dart package with Example
flutter create -t plugin . && flutter create -i swift -a kotlin --androidx example
Enter fullscreen mode Exit fullscreen mode
  • Watch Build Files
flutter packages pub run build_runner watch -—delete-conflicting-outputs
Enter fullscreen mode Exit fullscreen mode
  • Generate Build Files
flutter packages pub run build_runner build -—delete-conflicting-outputs
Enter fullscreen mode Exit fullscreen mode
  • Build Bug Report
flutter run —bug-report
Enter fullscreen mode Exit fullscreen mode
  • Flutter generate test coverage
flutter test --coverage && genhtml -o coverage coverage/lcov.info
Enter fullscreen mode Exit fullscreen mode
  • Rebuild Flutter Cache
flutter pub pub cache repair
Enter fullscreen mode Exit fullscreen mode
  • Conditional Export/Import
export 'unsupported.dart'if (dart.library.html) 'web.dart'if (dart.library.io) 'mobile.dart';
Enter fullscreen mode Exit fullscreen mode
  • Kill Dart Running
killall -9 dart
Enter fullscreen mode Exit fullscreen mode

Top comments (0)