How to make a flutter camera app that can run in K

2020-02-15 02:04发布

问题:

I am trying to make a flutter camera app. For this, I found a package named camera https://pub.dartlang.org/packages/camera which has been written by the flutter team itself. But, I found a serious limitation there. It needs a minimum SDK version of 21.

Looking at the current statistics from my previous app in play store, I found that a lot of my active users are using older devices running KitKat which has SDK 19. How should I deal with this?

回答1:

The code for that package:

https://github.com/flutter/plugins/blob/master/packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java

uses Android Camera2 API

and from this thread https://github.com/flutter/flutter/issues/9310 you are free to fork and create a version which supports the older Camera API available in KitKat