Skip to content

Latest commit

 

History

History
29 lines (26 loc) · 545 Bytes

20210413.md

File metadata and controls

29 lines (26 loc) · 545 Bytes

67 - Tyga

2021. 04. 13

  1. How to use JS with Flutter Web
  • web/app.js 생성, 내부에 함수 추가
function alertMessage(text) {
  alert(text)
} 
  • web/index.html
<head>
  <script src="app.js" defer></script>
</head> 
  • main.dart
import 'dart:js' as js;

js.context.callMethod('alertMessage', ['Flutter is calling upon JavaScript!']);
  1. How to trigger the enter keypress jQuery
var e = $.Event( "keypress", { which: 13 } );
$('#yourInput').trigger(e);