Closed GlauberAlc closed 3 years ago
Hey,
I did it this way:
import 'package:http/src/multipart_file.dart' as http;
import 'package:path_provider/path_provider.dart';
Future<String> get _localPath async {
final directory = await getApplicationDocumentsDirectory();
return directory.path;
}
Future<File> get _localFile async {
final path = await _localPath;
return File('$path/${DateTime.now()}.png');
}
Future saveSignature({@required Uint8List signData}) async {
///provide local path to store the signature
final signFile = await _localFile;
await File(signFile.path).writeAsBytes(signData.toList());
where signData is the signatureControllers.toPngBytes. just call the saveSignature and you can receive the signature path.
Hey man! Thank you!God bless you!
I'm trying to save a png signature image in the internal directory, but it saves nothing. How do I save the png signature file in the internal directory?
My code:
onPressed: () async { if (_controller.isNotEmpty) {