-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from GangemiLorenzo/feat/gh_actions_update
feat: Update the GH action workflows
- Loading branch information
Showing
8 changed files
with
236 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Pub Publish Workflow | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
build: | ||
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_pub_publish.yml@v1 | ||
with: | ||
pub_credentials: secrets.PUB_CREDENTIALS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
build/ | ||
pubspec.lock | ||
.vscode | ||
.git | ||
.git | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
THIS_FILE := $(lastword $(MAKEFILE_LIST)) | ||
|
||
help: | ||
@make -pRrq -f $(THIS_FILE) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | ||
|
||
unit: | ||
@flutter test | ||
|
||
cov: | ||
@flutter test --coverage && lcov --remove coverage/lcov.info '**/*.g.dart' -o coverage/lcov.info && genhtml coverage/lcov.info --output=coverage && open coverage/index.html | ||
|
||
clean: | ||
@rm -rf pubspec.lock | ||
@flutter clean | ||
|
||
format: | ||
@dart format . | ||
|
||
lint: | ||
@dart analyze . | ||
|
||
clean-pod: | ||
cd ios && pod deintegrate && pod update && cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
import 'package:aura_box/aura_box.dart'; // Import your AuraBox class | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:patrol_finders/patrol_finders.dart'; | ||
|
||
void main() { | ||
group('AuraBox', () { | ||
testWidgets('renders AuraSpot and ShaderMasks', | ||
(WidgetTester tester) async { | ||
final $ = PatrolTester( | ||
tester: tester, | ||
config: const PatrolTesterConfig(), | ||
); | ||
|
||
await $.pumpWidget( | ||
MaterialApp( | ||
home: AuraBox( | ||
spots: [ | ||
AuraSpot( | ||
color: Colors.blue, | ||
radius: 50, | ||
alignment: Alignment.center, | ||
blurRadius: 5, | ||
), | ||
AuraSpot( | ||
color: Colors.red, | ||
radius: 50, | ||
alignment: Alignment.bottomLeft, | ||
blurRadius: 5, | ||
), | ||
], | ||
child: Container(), | ||
), | ||
), | ||
); | ||
|
||
expect($(AuraBox), findsOneWidget); | ||
expect($(AuraBox).$(AuraSpot), findsNWidgets(2)); | ||
expect($(AuraBox).$(AuraSpot).$(ShaderMask), findsNWidgets(2)); | ||
}); | ||
|
||
testWidgets('applies decoration over the main container', | ||
(WidgetTester tester) async { | ||
final $ = PatrolTester( | ||
tester: tester, | ||
config: const PatrolTesterConfig(), | ||
); | ||
|
||
await $.pumpWidget( | ||
MaterialApp( | ||
home: AuraBox( | ||
spots: const [], | ||
decoration: BoxDecoration( | ||
color: Colors.red, | ||
borderRadius: BorderRadius.circular(10), | ||
), | ||
child: Container(), | ||
), | ||
), | ||
); | ||
|
||
// Verify that the decoration is applied correctly | ||
final container = | ||
$(AuraBox).$(Container).first.evaluate().single.widget as Container; | ||
final decoration = container.decoration! as BoxDecoration; | ||
expect(decoration.color, equals(Colors.red)); | ||
expect(decoration.shape, equals(BoxShape.rectangle)); | ||
expect(decoration.borderRadius, equals(BorderRadius.circular(10))); | ||
}); | ||
|
||
testWidgets('given decoration with border radius, applies ClipRRect', | ||
(WidgetTester tester) async { | ||
final $ = PatrolTester( | ||
tester: tester, | ||
config: const PatrolTesterConfig(), | ||
); | ||
|
||
await $.pumpWidget( | ||
MaterialApp( | ||
home: AuraBox( | ||
spots: [ | ||
AuraSpot( | ||
color: Colors.blue, | ||
radius: 50, | ||
alignment: Alignment.center, | ||
blurRadius: 5, | ||
stops: const [0.0, 0.5], | ||
), | ||
AuraSpot( | ||
color: Colors.red, | ||
radius: 50, | ||
alignment: Alignment.bottomLeft, | ||
blurRadius: 5, | ||
), | ||
], | ||
decoration: BoxDecoration( | ||
color: Colors.red, | ||
borderRadius: BorderRadius.circular(10), | ||
), | ||
child: Container(), | ||
), | ||
), | ||
); | ||
|
||
expect($(AuraBox).$(ClipRRect), findsNWidgets(2)); | ||
final clipRRect = | ||
$(AuraBox).$(ClipRRect).first.evaluate().single.widget as ClipRRect; | ||
expect(clipRRect.borderRadius, equals(BorderRadius.circular(10))); | ||
}); | ||
|
||
testWidgets('given decoration with BoxShape.circle, applies ClipOval', | ||
(WidgetTester tester) async { | ||
final $ = PatrolTester( | ||
tester: tester, | ||
config: const PatrolTesterConfig(), | ||
); | ||
|
||
await $.pumpWidget( | ||
MaterialApp( | ||
home: AuraBox( | ||
spots: [ | ||
AuraSpot( | ||
color: Colors.blue, | ||
radius: 50, | ||
alignment: Alignment.center, | ||
blurRadius: 5, | ||
stops: const [0.0, 0.5], | ||
), | ||
AuraSpot( | ||
color: Colors.red, | ||
radius: 50, | ||
alignment: Alignment.bottomLeft, | ||
blurRadius: 5, | ||
), | ||
], | ||
decoration: const BoxDecoration( | ||
color: Colors.red, | ||
shape: BoxShape.circle, | ||
), | ||
child: Container(), | ||
), | ||
), | ||
); | ||
|
||
expect($(AuraBox).$(ClipOval), findsNWidgets(2)); | ||
}); | ||
|
||
testWidgets('composes child and spots in a Stack', | ||
(WidgetTester tester) async { | ||
final $ = PatrolTester( | ||
tester: tester, | ||
config: const PatrolTesterConfig(), | ||
); | ||
await $.pumpWidget( | ||
MaterialApp( | ||
home: AuraBox( | ||
spots: [ | ||
AuraSpot( | ||
color: Colors.blue, | ||
radius: 50, | ||
alignment: Alignment.center, | ||
blurRadius: 5, | ||
stops: const [0.0, 0.5], | ||
), | ||
AuraSpot( | ||
color: Colors.red, | ||
radius: 50, | ||
alignment: Alignment.bottomLeft, | ||
blurRadius: 5, | ||
), | ||
], | ||
child: Container(), | ||
), | ||
), | ||
); | ||
|
||
expect($(Stack), findsOneWidget); | ||
final stack = $(Stack).evaluate().single.widget as Stack; | ||
expect(stack.children.length, equals(3)); | ||
}); | ||
}); | ||
} |