在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
解决方案: 1.在flutter引入 shared_preferences: ^2.0.6
2.Add this code in your MainActivity
import android.content.Context import android.os.Bundle import androidx.annotation.NonNull import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin import io.flutter.plugins.videoplayer.* class MainActivity : FlutterActivity() { override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { super.configureFlutterEngine(flutterEngine) flutterEngine.getPlugins().add(SharedPreferencesPlugin()) flutterEngine.getPlugins().add(VideoPlayerPlugin()) } }
|
请发表评论