close

使用path/path.dart

import 'package:path/path.dart' as path;

 

當使用takePicture 會拿到Xflie

late CameraController _controller;
var file = await _controller.takePicture();

 

final ch1 = File(file.path);
String dir = path.dirname(ch1.path);
final employeeId = Guid.newGuid;
String newPath = path.join(dir, '$employeeId.jpg'); // Rename
var ch2=ch1.renameSync(newPath);

要留意放置的地點,這個為在快取cache中
如果要放置在相簿 需要另外處理

 

 

 

 

 

 

 

 

 

 

 

arrow
arrow
    文章標籤
    Flutter
    全站熱搜

    萌新-工程師 發表在 痞客邦 留言(0) 人氣()