Skip to content

Commit f3f36bb

Browse files
committed
Switch from CircleCI to Gitub Actions
1 parent 30231b2 commit f3f36bb

File tree

9 files changed

+67
-56
lines changed

9 files changed

+67
-56
lines changed

.circleci/config.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test flutter_html
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: dart-lang/setup-dart@v1
15+
- uses: flutter-actions/setup-flutter@54feb1e258158303e041b9eaf89314dcfbf6d38a
16+
- name: Setup Melos
17+
run: flutter pub global activate melos
18+
- name: Bootstrap Project
19+
run: flutter pub global run melos bootstrap
20+
- name: Run Test Suite
21+
run: flutter pub global run melos run test
22+
- name: Compile Test Coverage Report
23+
run: flutter pub global run melos run gen_coverage
24+
- name: Upload Coverage to Codecov
25+
uses: codecov/codecov-action@v5
26+
with:
27+
files: coverage_report/lcov.info
28+
disable_search: true
29+
token: ${{ secrets.CODECOV_TOKEN }}
30+
- name: Run Dart Analysis
31+
run: flutter pub global run melos analyze --fatal-infos
32+
- name: Check that `dart format` has been run on every file
33+
run: dart format -o none --set-exit-if-changed

example/test/widget_test.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
void main() {}
1+
import 'package:flutter_test/flutter_test.dart';
2+
3+
void main() {
4+
test('Dummy test', () {
5+
expect(2 + 2, equals(4));
6+
});
7+
}

lib/src/builtins/interactive_element_builtin.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class InteractiveElementBuiltIn extends HtmlExtension {
6262
?.map((e) => _processInteractableChild(context, e))
6363
.toList(),
6464
recognizer: TapGestureRecognizer()..onTap = onTap,
65-
style: context.styledElement?.style.generateTextStyle() ?? childSpan.style,
65+
style:
66+
context.styledElement?.style.generateTextStyle() ?? childSpan.style,
6667
semanticsLabel: childSpan.semanticsLabel,
6768
locale: childSpan.locale,
6869
mouseCursor: childSpan.mouseCursor,

lib/src/css_box_widget.dart

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ class CssBoxWidget extends StatelessWidget {
8080
child: top
8181
? child
8282
: MediaQuery(
83-
data: MediaQuery.of(context).copyWith(textScaler: TextScaler.linear(1.0)),
83+
data: MediaQuery.of(context)
84+
.copyWith(textScaler: TextScaler.linear(1.0)),
8485
child: child,
8586
),
8687
),
@@ -484,8 +485,8 @@ class RenderCSSBox extends RenderBox
484485
}
485486

486487
@override
487-
double? computeDryBaseline(covariant BoxConstraints constraints,
488-
TextBaseline baseline) {
488+
double? computeDryBaseline(
489+
covariant BoxConstraints constraints, TextBaseline baseline) {
489490
return null;
490491
}
491492

@@ -532,9 +533,15 @@ class RenderCSSBox extends RenderBox
532533
// `width: double.infinity` on the inner Container, but we do it here
533534
// to keep the infinite width from being applied if the parent's width is
534535
// also infinite.
535-
if(display.isBlock && !shrinkWrap && !childIsReplaced && containingBlockSize.width.isFinite) {
536+
if (display.isBlock &&
537+
!shrinkWrap &&
538+
!childIsReplaced &&
539+
containingBlockSize.width.isFinite) {
536540
childConstraints = childConstraints.enforce(BoxConstraints(
537-
maxWidth: math.max(containingBlockSize.width, childConstraints.maxWidth),
541+
maxWidth: math.max(
542+
containingBlockSize.width,
543+
childConstraints.maxWidth,
544+
),
538545
minWidth: childConstraints.maxWidth,
539546
));
540547
}
@@ -556,7 +563,9 @@ class RenderCSSBox extends RenderBox
556563
width = childSize.width + horizontalMargins;
557564
height = childSize.height + verticalMargins;
558565
} else if (display.isBlock) {
559-
width = (shrinkWrap || childIsReplaced || containingBlockSize.width.isInfinite)
566+
width = (shrinkWrap ||
567+
childIsReplaced ||
568+
containingBlockSize.width.isInfinite)
560569
? childSize.width + horizontalMargins
561570
: containingBlockSize.width;
562571
height = childSize.height + verticalMargins;
@@ -808,7 +817,9 @@ extension Normalize on Dimension {
808817

809818
double _calculateEmValue(Style style, BuildContext buildContext) {
810819
return (style.fontSize?.emValue ?? 16) *
811-
(MediaQuery.maybeTextScalerOf(buildContext)?.scale(style.fontSize?.emValue ?? 16) ?? 1.0) *
820+
(MediaQuery.maybeTextScalerOf(buildContext)
821+
?.scale(style.fontSize?.emValue ?? 16) ??
822+
1.0) *
812823
MediaQuery.of(buildContext).devicePixelRatio;
813824
}
814825

lib/src/tree/styled_element.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class StyledElement {
3333
return false;
3434
}
3535
}
36-
36+
3737
bool matchesSelector(String selector) {
3838
return (element != null && matches(element!, selector)) || name == selector;
3939
}

packages/flutter_html_audio/lib/flutter_html_audio.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class _AudioWidgetState extends State<AudioWidget> {
6060
];
6161

6262
if (sources.isNotEmpty && sources.first != null) {
63-
audioController = VideoPlayerController.network(
64-
sources.first ?? "",
63+
audioController = VideoPlayerController.networkUrl(
64+
Uri.tryParse(sources.first ?? "") ?? Uri(),
6565
);
6666
chewieAudioController = ChewieAudioController(
6767
videoPlayerController: audioController!,

packages/flutter_html_video/lib/flutter_html_video.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ class _VideoWidgetState extends State<VideoWidget> {
8383
VideoPlayerController.file(File.fromUri(sourceUri));
8484
break;
8585
default:
86-
_videoController =
87-
VideoPlayerController.networkUrl(sourceUri);
86+
_videoController = VideoPlayerController.networkUrl(sourceUri);
8887
break;
8988
}
9089
_chewieController = ChewieController(

test/elements/a_test.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ void main() {
5757
),
5858
),
5959
);
60-
expect(find.text("Hello, world!", findRichText: true), findsOneWidget);
60+
final finder = find.textRange.ofSubstring("Hello, world!");
61+
expect(finder, findsOne);
6162
expect(tappedUrl, equals(""));
62-
await tester.tap(find.text("Hello, world!", findRichText: true));
63+
await tester.tapOnText(finder);
6364
expect(tappedUrl, equals("https://example.com"));
6465
});
6566

0 commit comments

Comments
 (0)