반응형
반응형
import 'dart:io'; import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; void main() { runApp( const MaterialApp( home: WebViewApp(), ), ); } class WebViewApp extends StatefulWidget { const WebViewApp({Key? key}) : super(key: key); @override State createState() => _WebViewAppState(); } class _WebViewAppState extends State { @override final controller = Web..
. 서버 실행 [@localhost socket_server]# php server2_php.php SocketManager.dart import 'dart:io'; class SocketManager { late Socket _socket; bool _connected = false; static const String host = "220.72.212."; // php server static const int port = 25003; // static const String host = "13.125.57."; // mymq // static const int port = 9001; Future connectToSocket() async { try { _socket = await Socket.con..
목적 : flutter 에서 hexString 을 byte 로 변환하여 접속된 소켓으로 보내려고 한다. javascript 에서는 hexString 을 Uint8Array 로 변환한다. (arrayBuffer) # inutString 0000012931334331202020202020202020202020646f6d202020202057313931304130312020202020202020202020202020202020202020202020202020202020203030302e3030302e3030302e303030203030302e3030302e3030302e3030302030302d30302d30302d30302d30302d30302020205330313832383520202020202020202..
서버 실행 [@localhost socket_server]# php server2_php.php flutter 코드 import 'dart:io'; import 'dart:convert'; import 'dart:async'; main() async { const String host = "220.72.212.xxx"; const int port = 25003; Socket socket = await Socket.connect(host, port); print('connected'); socket.listen((List event) { print(utf8.decode(event)); }); socket.add(utf8.encode('hello222')); await Future.delayed(const ..
아래와 같은 배열이 있습니다. 0: {id: 'prdctCd', value: 'USKRW'} 1: {id: 'realCode', value: 'USDKRW300'} length: 2 배열의 키가 0 , 1 숫자로 되어 있는것을 객체로 변경해야 할때가 있습니다. prdctCd: {id:'prdctCd', value:'USKRW'}, realCode: {id:'realCode', value:'USDKRW300'} 이렇게 변경하는 이유는 배열의 0 으로 접근하는 것보다는 키로 접근하는게 가독성이 좋습니다. 1차원 배열 변경 방법 const tmp = [ {id:'prdctCd', value:'USKRW'}, {id:'realCode', value:'USDKRW300'} ]; const object = tmp...
composition api 의 send.vue (자식 컴포넌트) 주의) defineExpose 없으면 작동하지 않습니다. 참고 : https://stackoverflow.com/questions/72223441/call-a-function-from-another-component-using-composition-api Call a function from another component using composition API Below is a code for a header and a body (different components). How do you call the continue function of the component 2 and pass a parameter when you are in..