Flutter Dart Notes
Programming
Reference / examples of code
- https://github.com/gskinnerTeam/flutter-folio/blob/master/lib/_utils/easy_notifier.dart
- Excellent code - 2 years old.
- https://docs.flutter.dev/cookbook
Support Tools
Startup
Terminal
export PATH="$PATH:/Users/dlr/workspace/flutter/bin"
Create Project
- Invoke View > Command Palette.
- Type “flutter”, and select the Flutter: New Project.
- Select Application.
- Create or select the parent directory for the new project folder.
- Enter a project name, such as
my_app
, and press Enter. - Wait for project creation to complete and the
main.dart
file to appear.
Setup
- https://docs.flutter.dev/get-started/install/macos
- https://developer.android.com/studio/index.html
- https://guides.cocoapods.org/using/getting-started.html#installation
- Error on cocopods install - use “brew install cocopods” and not the local ruby version.
- See Video with install process and glitches.
Video_player
How to find a video format that plays for all devices: https://stackoverflow.com/questions/55326957/problems-reproducing-video-on-both-system-android-ios
AVPlayer iOS is not support H265 video, you can try other videos (H264, H263) ? confirm? from https://github.com/flutter/flutter/issues/62785
https://stackoverflow.com/questions/14171826/converting-video-for-android-using-ffmpeg The MP4 created by ffmpeg has the moov header at the tail. That is why you are getting this error message. ffmpeg can put the moov header in front (suitable for streaming).
ffmpeg -i <input> -c:v libx264 -c:a aac -movflags faststart -vprofile baseline output.mp4
-movflags faststart [mp4 @ 0x137705380] Starting second pass: moving the moov atom to the beginning of the file1x
Trying this for HDR Video: from https://superuser.com/questions/1549201/ffmpeg-could-not-find-tag-for-codec-none ffmpeg -i IMG_0368.mov -tag:v hvc1 -codec:v libx265 -x265-params crf=“26” -codec:a aac -preset fast “compressedfile-ffmpeg-h265-crf26.mp4”
This works and doesn’t need the HVC1 tag as its a H.264 video. ffmpeg -i IMG_0368.mov -c:v libx264 -crf 26 -vf format=yuv420p -c:a aac -movflags faststart output.mp4
https://trac.ffmpeg.org/wiki/Encode/H.265
To make your H.265 file compatible with Apple “industry standard” H.265 you have to add the following argument -tag:v hvc1
https://superuser.com/questions/1380946/how-do-i-convert-10-bit-h-265-hevc-videos-to-h-264-without-quality-loss Converting 10bit or 12 bit HEVC to 8bit for simpler playing.
Android OS video formats supported: https://developer.android.com/guide/topics/media/exoplayer/supported-formats
Reference
THANK YOU Stuart Morgan!! MacOS X Video_Player support. https://github.com/flutter/packages/commit/d0e9a0e1b3ac1f8afeba2a30da6d30fa06d96a48