Skip to content

Commit cb62649

Browse files
committed
some review fixes
1 parent 5421b50 commit cb62649

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

example/lib/charts/basic_line_chart.dart

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class BasicLineChart extends StatefulWidget {
1212
}
1313

1414
class _BasicLineChartState extends State<BasicLineChart> {
15-
1615
final controller = GraphifyController();
1716
Timer? timer;
1817

@@ -28,14 +27,13 @@ class _BasicLineChartState extends State<BasicLineChart> {
2827
]
2928
});
3029
});
31-
3230
}
3331

3432
@override
3533
Widget build(BuildContext context) {
3634
return GraphifyView(
3735
controller: controller,
38-
onConsoleMessage: <String>(message) {
36+
onConsoleMessage: (message) {
3937
print("[ERROR] $message");
4038
},
4139
initialOptions: const {
@@ -44,9 +42,7 @@ class _BasicLineChartState extends State<BasicLineChart> {
4442
"type": "category",
4543
"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
4644
},
47-
"yAxis": {
48-
"type": "value"
49-
},
45+
"yAxis": {"type": "value"},
5046
"series": [
5147
{
5248
"data": [150, 230, 224, 218, 135, 147, 260],
@@ -63,5 +59,4 @@ class _BasicLineChartState extends State<BasicLineChart> {
6359
controller.dispose();
6460
super.dispose();
6561
}
66-
6762
}

lib/src/view/implements/mobile.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:async';
2+
13
import 'package:flutter/material.dart';
24
import 'package:graphify/src/controller/implements/mobile.dart';
35
import 'package:graphify/src/resources/dependencies.js.dart';
@@ -62,9 +64,8 @@ class _GraphifyViewState extends g_view.GraphifyViewState<GraphifyView> {
6264
if (widget.controller == null) {
6365
controller.dispose();
6466
}
65-
webViewController
66-
..clearLocalStorage()
67-
..clearCache();
67+
unawaited(webViewController.clearLocalStorage());
68+
unawaited(webViewController.clearCache());
6869
super.dispose();
6970
}
7071
}

lib/src/view/implements/web.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class _GraphifyViewState extends g_view.GraphifyViewState<GraphifyView> {
7575
..id = 'graphify-click-channel-shim-$uid'
7676
..innerHTML = '''
7777
(function(uid){
78-
// Definisci il channel solo se non già presente
78+
// Define the channel only if not already present
7979
if (!window.ClickEventChannel) {
8080
window.ClickEventChannel = {
8181
postMessage: function(payload) {
@@ -85,7 +85,7 @@ class _GraphifyViewState extends g_view.GraphifyViewState<GraphifyView> {
8585
chartId: uid,
8686
payload: String(payload)
8787
});
88-
// Inoltra come stringa: il controller web si aspetta un JSON string
88+
// Forward as a string: the web controller expects a JSON string
8989
window.postMessage(envelope, '*');
9090
} catch (e) {
9191
console.error('ClickEventChannel shim error', e);

0 commit comments

Comments
 (0)