26. 拍照&相册&相关操作

image_picker 第三方

import 'package:image_picker/image_picker.dart';
inal ImagePicker _picker = ImagePicker();
   // 打开相册
   final XFile? image = await _picker.pickImage(source: ImageSource.gallery);
   // 打开相机
   final XFile? photo = await _picker.pickImage(source: ImageSource.camera);
   // 打开相机相册
   final XFile? image = await _picker.pickVideo(source: ImageSource.gallery);
   // 打开摄像机
   final XFile? video = await _picker.pickVideo(source: ImageSource.camera);

照片回显

import "darat:io";
Image.File(File(image!.path))

视频回显

late VideoPlayerController videoPlayerController ;
late ChewieController chewieController ;

initVoide(url){
   videoPlayerController = VideoPlayerController.file(url);
   chewieController = ChewieController(
  videoPlayerController:videoPlayerController
  )
}

Chewie(
controller: chewieController,
)
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇