Skip to content

Commit 54fd6c7

Browse files
authored
Merge pull request #28 from warioddly/dev
Dev
2 parents 9235b4c + cb55779 commit 54fd6c7

File tree

20 files changed

+119
-69
lines changed

20 files changed

+119
-69
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2+
## 1.1.0
3+
4+
* Fix bug with background color
5+
* Optimize render
6+
17
## 1.0.9
28

39
* Add linear, radial gradient support for charts

example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlin_version = '1.7.10'
2+
ext.kotlin_version = '1.8.10'
33
repositories {
44
google()
55
mavenCentral()

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip

example/android/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pluginManagement {
2323

2424
plugins {
2525
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
26-
id "com.android.application" version "7.3.0" apply false
26+
id "com.android.application" version "8.1.0" apply false
2727
}
2828

2929
include ":app"

example/lib/charts/basic_bar_chart.dart

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class BasicBarChart extends StatefulWidget {
1414
class _BasicBarChartState extends State<BasicBarChart> {
1515

1616
final controller = GraphifyController();
17+
var _chartCreated = false;
1718
Timer? timer;
1819

1920
@override
@@ -33,23 +34,51 @@ class _BasicBarChartState extends State<BasicBarChart> {
3334

3435
@override
3536
Widget build(BuildContext context) {
36-
return GraphifyView(
37-
controller: controller,
38-
initialOptions: const {
39-
"xAxis": {
40-
"type": "category",
41-
"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
42-
},
43-
"yAxis": {
44-
"type": "value"
45-
},
46-
"series": [
47-
{
48-
"data": [120, 200, 150, 80, 70, 110, 130],
49-
"type": "bar"
50-
}
51-
]
52-
},
37+
return Stack(
38+
children: [
39+
40+
GraphifyView(
41+
controller: controller,
42+
onCreated: () async {
43+
await Future.delayed(const Duration(milliseconds: 400));
44+
setState(() {
45+
_chartCreated = true;
46+
});
47+
},
48+
initialOptions: const {
49+
'backgroundColor': 'transparent',
50+
"xAxis": {
51+
"type": "category",
52+
"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
53+
},
54+
"yAxis": {
55+
"type": "value"
56+
},
57+
"series": [
58+
{
59+
"data": [120, 200, 150, 80, 70, 110, 130],
60+
"type": "bar"
61+
}
62+
],
63+
},
64+
),
65+
66+
if (!_chartCreated)
67+
Positioned.fill(
68+
child: Container(
69+
color: Colors.white,
70+
child: const Center(
71+
child: SizedBox.square(
72+
dimension: 100,
73+
child: CircularProgressIndicator.adaptive(
74+
backgroundColor: Colors.green,
75+
),
76+
)
77+
)
78+
),
79+
),
80+
81+
],
5382
);
5483
}
5584

example/lib/charts/basic_line_chart.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ class _BasicLineChartState extends State<BasicLineChart> {
3636
return GraphifyView(
3737
controller: controller,
3838
onConsoleMessage: (message) {
39-
print("awdawd message$message");
39+
print("[ERROR] $message");
4040
},
4141
initialOptions: const {
42+
"backgroundColor": 'transparent',
4243
"xAxis": {
4344
"type": "category",
4445
"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]

example/lib/charts/nested_pies_chart.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class NestedPiesChart extends StatelessWidget {
99
return GraphifyView(
1010
controller: GraphifyController(),
1111
initialOptions: const {
12+
"backgroundColor": 'transparent',
1213
"tooltip": {"trigger": "item", "formatter": "{a} <br/>{b}: {c} ({d}%)"},
1314
"legend": {
1415
"data": [

example/pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ packages:
104104
path: ".."
105105
relative: true
106106
source: path
107-
version: "1.0.8"
107+
version: "1.0.9"
108108
integration_test:
109109
dependency: "direct dev"
110110
description: flutter
@@ -383,10 +383,10 @@ packages:
383383
dependency: transitive
384384
description:
385385
name: webview_flutter_wkwebview
386-
sha256: d7403ef4f042714c9ee2b26eaac4cadae7394cb0d4e608b1dd850c3ff96bd893
386+
sha256: c49a98510080378b1525132f407a92c3dcd3b7145bef04fb8137724aadcf1cf0
387387
url: "https://pub.dev"
388388
source: hosted
389-
version: "3.18.2"
389+
version: "3.18.4"
390390
sdks:
391391
dart: ">=3.7.0-0 <4.0.0"
392392
flutter: ">=3.27.0"

example/web/index.html

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,14 @@
3434

3535
<script>
3636
// The value below is injected by flutter build, do not touch.
37-
const serviceWorkerVersion = null;
37+
var serviceWorkerVersion = '{{flutter_service_worker_version}}';
3838
</script>
3939
<!-- This script adds the flutter initialization JS code -->
4040
<script src="flutter.js" defer></script>
4141
</head>
4242
<body>
4343
<script>
44-
window.addEventListener('load', function(ev) {
45-
// Download main.dart.js
46-
_flutter.loader.loadEntrypoint({
47-
serviceWorker: {
48-
serviceWorkerVersion: serviceWorkerVersion,
49-
},
50-
onEntrypointLoaded: function(engineInitializer) {
51-
engineInitializer.initializeEngine().then(function(appRunner) {
52-
appRunner.runApp();
53-
});
54-
}
55-
});
56-
});
44+
{{flutter_bootstrap_js}}
5745
</script>
5846
</body>
5947
</html>

lib/src/resources/dependencies.js.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ const String chartScripts = """
4141
4242
""";
4343

44-
const htmlDependencies = "<script>$dependencies</script>";

0 commit comments

Comments
 (0)