@@ -46,9 +46,7 @@ class _DartCallJsPageState extends State<DartCallJsPage> {
4646 Widget build (BuildContext context) {
4747 return Scaffold (
4848 backgroundColor: Colors .white,
49- appBar: AppBar (
50- title: const Text ('Dart call JavaScript' ),
51- ),
49+ appBar: AppBar (title: const Text ('Dart call JavaScript' )),
5250 body: Padding (
5351 padding: const EdgeInsets .symmetric (horizontal: 20 ),
5452 child: SingleChildScrollView (
@@ -58,61 +56,82 @@ class _DartCallJsPageState extends State<DartCallJsPage> {
5856 FilledButton (
5957 child: const Text ('addValue(3,4)' ),
6058 onPressed: () {
61- _controller.callHandler ('addValue' , args: [3 , 4 ],
62- handler: (retValue) {
63- Fluttertoast .showToast (msg: retValue.toString ());
64- });
59+ _controller.callHandler (
60+ 'addValue' ,
61+ args: [3 , 4 ],
62+ handler: (retValue) {
63+ Fluttertoast .showToast (msg: retValue.toString ());
64+ },
65+ );
6566 },
6667 ),
6768 FilledButton (
6869 child: const Text ("append('I','love','you')" ),
6970 onPressed: () {
70- _controller.callHandler ('append' , args: ["I" , "love" , "you" ],
71- handler: (retValue) {
72- Fluttertoast .showToast (msg: retValue.toString ());
73- });
71+ _controller.callHandler (
72+ 'append' ,
73+ args: ["I" , "love" , "you" ],
74+ handler: (retValue) {
75+ Fluttertoast .showToast (msg: retValue.toString ());
76+ },
77+ );
7478 },
7579 ),
7680 FilledButton (
7781 child: const Text ('startTimer()' ),
7882 onPressed: () {
79- _controller.callHandler ('startTimer' , handler: (retValue) {
80- Fluttertoast .showToast (msg: retValue.toString ());
81- });
83+ _controller.callHandler (
84+ 'startTimer' ,
85+ handler: (retValue) {
86+ Fluttertoast .showToast (msg: retValue.toString ());
87+ },
88+ );
8289 },
8390 ),
8491 FilledButton (
8592 child: const Text ('syn.addValue(5,6)' ),
8693 onPressed: () {
87- _controller.callHandler ('syn.addValue' , args: [5 , 6 ],
88- handler: (retValue) {
89- Fluttertoast .showToast (msg: retValue.toString ());
90- });
94+ _controller.callHandler (
95+ 'syn.addValue' ,
96+ args: [5 , 6 ],
97+ handler: (retValue) {
98+ Fluttertoast .showToast (msg: retValue.toString ());
99+ },
100+ );
91101 },
92102 ),
93103 FilledButton (
94104 child: const Text ('syn.getInfo()' ),
95105 onPressed: () {
96- _controller.callHandler ('syn.getInfo' , handler: (retValue) {
97- Fluttertoast .showToast (msg: retValue.toString ());
98- });
106+ _controller.callHandler (
107+ 'syn.getInfo' ,
108+ handler: (retValue) {
109+ Fluttertoast .showToast (msg: retValue.toString ());
110+ },
111+ );
99112 },
100113 ),
101114 FilledButton (
102115 child: const Text ('asyn.addValue(5,6)' ),
103116 onPressed: () {
104- _controller.callHandler ('asyn.addValue' , args: [5 , 6 ],
105- handler: (retValue) {
106- Fluttertoast .showToast (msg: retValue.toString ());
107- });
117+ _controller.callHandler (
118+ 'asyn.addValue' ,
119+ args: [5 , 6 ],
120+ handler: (retValue) {
121+ Fluttertoast .showToast (msg: retValue.toString ());
122+ },
123+ );
108124 },
109125 ),
110126 FilledButton (
111127 child: const Text ('asyn.getInfo()' ),
112128 onPressed: () {
113- _controller.callHandler ('asyn.getInfo' , handler: (retValue) {
114- Fluttertoast .showToast (msg: retValue.toString ());
115- });
129+ _controller.callHandler (
130+ 'asyn.getInfo' ,
131+ handler: (retValue) {
132+ Fluttertoast .showToast (msg: retValue.toString ());
133+ },
134+ );
116135 },
117136 ),
118137 FilledButton (
@@ -150,7 +169,7 @@ class _DartCallJsPageState extends State<DartCallJsPage> {
150169 SizedBox (
151170 height: 10 ,
152171 child: DWebViewWidget (controller: _controller),
153- )
172+ ),
154173 ],
155174 ),
156175 ),
0 commit comments