Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geekyants_flutter_gauges: 1.0.4 #265

Merged
merged 21 commits into from
May 6, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
## 1.0.4

**Features**

- Add Custom Track Labels to Radial Gauge

**Fixes**

- Fixed needle-gap issue in Radial Gauge

## 1.0.3

**Fixes**

- Fixed Drawing of `Pointer` over `valueBar`


## 1.0.2

**Features**
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ This will add a line like this to your package's pubspec.yaml (and run an implic

```dart
dependencies:
geekyants_flutter_gauges: 1.0.2
geekyants_flutter_gauges: 1.0.4
```

## Usage
2 changes: 1 addition & 1 deletion example/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -182,7 +182,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
80 changes: 52 additions & 28 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -37,18 +37,18 @@ packages:
dependency: transitive
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.2"
version: "1.18.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
url: "https://pub.dev"
source: hosted
version: "1.0.5"
version: "1.0.8"
fake_async:
dependency: transitive
description:
@@ -66,10 +66,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "2.0.3"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -81,47 +81,71 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.2"
version: "1.0.3"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
url: "https://pub.dev"
source: hosted
version: "2.0.1"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
url: "https://pub.dev"
source: hosted
version: "2.0.1"
lints:
dependency: transitive
description:
name: lints
sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593"
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "2.1.1"
matcher:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.16"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.11.0"
path:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
sky_engine:
dependency: transitive
description: flutter
@@ -139,18 +163,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
string_scanner:
dependency: transitive
description:
@@ -171,10 +195,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
version: "0.6.1"
vector_math:
dependency: transitive
description:
@@ -183,14 +207,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
vm_service:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
version: "13.0.0"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
dart: ">=3.2.0-0 <4.0.0"
flutter: ">=1.17.0"
1 change: 1 addition & 0 deletions test/custom_curve_test/custom_curve_test.dart
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ class MyCustomCurveGauge extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
useMaterial3: false,
fontFamily: 'Roboto',
),
home: Scaffold(
1 change: 1 addition & 0 deletions test/custom_labels_test/custom_labels_test.dart
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ class MyPointerTestLinearGauge extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
useMaterial3: false,
fontFamily: 'Roboto',
),
home: Scaffold(
4 changes: 1 addition & 3 deletions test/extend_linear_gauge_test/extend_linear_gauge_test.dart
Original file line number Diff line number Diff line change
@@ -43,9 +43,7 @@ class MyExtendLinearGaugeTest extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
fontFamily: 'Roboto',
),
theme: ThemeData(fontFamily: 'Roboto', useMaterial3: false),
home: Scaffold(
appBar: AppBar(
title: const Text("Default LinearGauge"),
73 changes: 57 additions & 16 deletions test/flutter_test_config.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,63 @@
import 'dart:async';
import 'dart:io';

import 'package:golden_toolkit/golden_toolkit.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_test/flutter_test.dart';

// All tests in this folder and its subfolders will have the configuration defined here
const _kGoldenTestsThreshold = 10 / 100; // 1% tolerance

Future<void> testExecutable(FutureOr<void> Function() testMain) async {
return GoldenToolkit.runWithConfiguration(
() async {
await loadAppFonts();
await testMain();
},
config: GoldenToolkitConfiguration(
// Currently, goldens are not generated/validated in CI for this repo. We have settled on the goldens for this package
// being captured/validated by developers running on MacOSX. We may revisit this in the future if there is a reason to invest
// in more sophistication
skipGoldenAssertion: () => !Platform.isMacOS,
enableRealShadows: true,
),
);
if (goldenFileComparator is LocalFileComparator) {
final testUrl = (goldenFileComparator as LocalFileComparator).basedir;

goldenFileComparator = LocalFileComparatorWithThreshold(
Uri.parse('$testUrl/test. dart'),
_kGoldenTestsThreshold,
);
} else {
throw Exception(
'Expected goldenFileComparator to be of type'
'LocalFileComparator'
'but it is of type ${goldenFileComparator.runtimeType}`',
);
}
await testMain();
}

/// Works just like [LocalFileComparator] but includes a [threshold] that, when
/// exceeded, marks the test as a failure.
class LocalFileComparatorWithThreshold extends LocalFileComparator {
/// Threshold above which tests will be marked as failing.
/// Ranges from 0 to 1, both inclusive.
final double threshold;

LocalFileComparatorWithThreshold(Uri testFile, this.threshold)
: assert(threshold >= 0 && threshold <= 1),
super(testFile);

/// Copy of [LocalFileComparator]'s [compare] method, except for the fact that
/// it checks if the [ComparisonResult.diffPercent] is not greater than
/// [threshold] to decide whether this test is successful or a failure.
@override
Future<bool> compare(Uint8List imageBytes, Uri golden) async {
final result = await GoldenFileComparator.compareLists(
imageBytes,
await getGoldenBytes(golden),
);

if (!result.passed && result.diffPercent <= threshold) {
print(
'A difference of ${result.diffPercent * 100}% was found, but it is '
'acceptable since it is not greater than the threshold of '
'${threshold * 100}%',
);

return true;
}

if (!result.passed) {
final error = await generateFailureOutput(result, golden, basedir);
throw FlutterError(error);
}
return result.passed;
}
}
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ class MyLinearGaugeContainer extends StatelessWidget {
return MaterialApp(
theme: ThemeData(
fontFamily: 'Roboto',
useMaterial3: false,
),
home: Scaffold(
appBar: AppBar(
1 change: 1 addition & 0 deletions test/pointers_test/pointers_test.dart
Original file line number Diff line number Diff line change
@@ -76,6 +76,7 @@ class MyPointerTestLinearGauge extends StatelessWidget {
return MaterialApp(
theme: ThemeData(
fontFamily: 'Roboto',
useMaterial3: false,
),
home: Scaffold(
appBar: AppBar(
1 change: 1 addition & 0 deletions test/range_linear_gauge_test/range_linear_test.dart
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ class MyRangeLinearGauge extends StatelessWidget {
return MaterialApp(
theme: ThemeData(
fontFamily: 'Roboto',
useMaterial3: false,
),
home: Scaffold(
appBar: AppBar(
1 change: 1 addition & 0 deletions test/shader_paint_test/shader_paint_test.dart
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ class MyValuBarTestLinearGauge extends StatelessWidget {
return MaterialApp(
theme: ThemeData(
fontFamily: 'Roboto',
useMaterial3: false,
),
home: Scaffold(
appBar: AppBar(
1 change: 1 addition & 0 deletions test/value_bar_test/value_bar_test.dart
Original file line number Diff line number Diff line change
@@ -52,6 +52,7 @@ class MyValuBarTestLinearGauge extends StatelessWidget {
return MaterialApp(
theme: ThemeData(
fontFamily: 'Roboto',
useMaterial3: false,
),
home: Scaffold(
appBar: AppBar(
Loading