Skip to content

Instantly share code, notes, and snippets.

@doyle-flutter
Created February 15, 2021 08:43
Show Gist options
  • Save doyle-flutter/a9cb09e1d7a717d5cd5a159c76374551 to your computer and use it in GitHub Desktop.
Save doyle-flutter/a9cb09e1d7a717d5cd5a159c76374551 to your computer and use it in GitHub Desktop.
import 'dart:typed_data';
import 'package:flutter/services.dart';
class CameraLogic{
// 촬영한 이미지를 저장하는 변수
Uint8List camData;
// 촬영 기능 실행
Future<void> camActionChannel() async => await new MethodChannel("app.james.cam/cam").invokeMethod<void>("cam");
// 촬영한 이미지를 받음
void channelOnData(Function(Uint8List) logic) => new MethodChannel("app.james.cam/cam2").setMethodCallHandler((call){
if(call.method == "sendImg"){
final Uint8List _data = call.arguments;
this.camData = _data;
logic(this.camData);
}
return;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment