10000 chore: Switch from CircleCI to Github Actions by Sub6Resources · Pull Request #1465 · Sub6Resources/flutter_html · GitHub
[go: up one dir, main page]

Skip to content

chore: Switch from CircleCI to Github Actions #1465

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

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 0 additions & 40 deletions .circleci/config.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test flutter_html

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- uses: flutter-actions/setup-flutter@54feb1e258158303e041b9eaf89314dcfbf6d38a
- name: Setup Melos
run: flutter pub global activate melos
- name: Bootstrap Project
run: flutter pub global run melos bootstrap
- name: Run Test Suite
run: flutter pub global run melos run test
- name: Compile Test Coverage Report
run: flutter pub global run melos run gen_coverage
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage_report/lcov.info
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run Dart Analysis
run: flutter pub global run melos analyze --fatal-infos
- name: Check that `dart format` has been run on every file
run: dart format -o none --set-exit-if-changed
8 changes: 7 additions & 1 deletion example/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
void main() {}
import 'package:flutter_test/flutter_test.dart';

void main() {
test('Dummy test', () {
expect(2 + 2, equals(4));
});
}
3 changes: 2 additions & 1 deletion lib/src/builtins/interactive_element_builtin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class InteractiveElementBuiltIn extends HtmlExtension {
?.map((e) => _processInteractableChild(context, e))
.toList(),
recognizer: TapGestureRecognizer()..onTap = onTap,
style: context.styledElement?.style.generateTextStyle() ?? childSpan.style,
style:
context.styledElement?.style.generateTextStyle() ?? childSpan.style,
semanticsLabel: childSpan.semanticsLabel,
locale: childSpan.locale,
mouseCursor: childSpan.mouseCursor,
Expand Down
25 changes: 18 additions & 7 deletions lib/src/css_box_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ class CssBoxWidget extends StatelessWidget {
child: top
? child
: MediaQuery(
data: MediaQuery.of(context).copyWith(textScaler: TextScaler.linear(1.0)),
data: MediaQuery.of(context)
.copyWith(textScaler: TextScaler.linear(1.0)),
child: child,
),
),
Expand Down Expand Up @@ -484,8 +485,8 @@ class RenderCSSBox extends RenderBox
}

@override
double? computeDryBaseline(covariant BoxConstraints constraints,
TextBaseline baseline) {
double? computeDryBaseline(
covariant BoxConstraints constraints, TextBaseline baseline) {
return null;
}

Expand Down Expand Up @@ -532,9 +533,15 @@ class RenderCSSBox extends RenderBox
// `width: double.infinity` on the inner Container, but we do it here
// to keep the infinite width from being applied if the parent's width is
// also infinite.
if(display.isBlock && !shrinkWrap && !childIsReplaced && containingBlockSize.width.isFinite) {
if (display.isBlock &&
!shrinkWrap &&
!childIsReplaced &&
containingBlockSize.width.isFinite) {
childConstraints = childConstraints.enforce(BoxConstraints(
maxWidth: math.max(containingBlockSize.width, childConstraints.maxWidth),
maxWidth: math.max(
containingBlockSize.width,
childConstraints.maxWidth,
),
minWidth: childConstraints.maxWidth,
));
}
Expand All @@ -556,7 +563,9 @@ class RenderCSSBox extends RenderBox
width = childSize.width + horizontalMargins;
height = childSize.height + verticalMargins;
} else if (display.isBlock) {
width = (shrinkWrap || childIsReplaced || containingBlockSize.width.isInfinite)
width = (shrinkWrap ||
childIsReplaced ||
containingBlockSize.width.isInfinite)
? childSize.width + horizontalMargins
: containingBlockSize.width;
height = childSize.height + verticalMargins;
Expand Down Expand Up @@ -808,7 +817,9 @@ extension Normalize on Dimension {

double _calculateEmValue(Style style, BuildContext buildContext) {
return (style.fontSize?.emValue ?? 16) *
(MediaQuery.maybeTextScalerOf(buildContext)?.scale(style.fontSize?.emValue ?? 16) ?? 1.0) *
(MediaQuery.maybeTextScalerOf(buildContext)
?.scale(style.fontSize?.emValue ?? 16) ??
1.0) *
MediaQuery.of(buildContext).devicePixelRatio;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/tree/styled_element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class StyledElement {
return false;
}
}

bool matchesSelector(String selector) {
return (element != null && matches(element!, selector)) || name == selector;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_html_audio/lib/flutter_html_audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class _AudioWidgetState extends State<AudioWidget> {
];

if (sources.isNotEmpty && sources.first != null) {
audioController = VideoPlayerController.network(
sources.first ?? "",
audioController = VideoPlayerController.networkUrl(
Uri.tryParse(sources.first ?? "") ?? Uri(),
);
chewieAudioController = ChewieAudioController(
videoPlayerController: audioController!,
Expand Down
3 changes: 1 addition & 2 deletions packages/flutter_html_video/lib/flutter_html_video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ class _VideoWidgetState extends State<VideoWidget> {
VideoPlayerController.file(File.fromUri(sourceUri));
break;
default:
_videoController =
VideoPlayerController.networkUrl(sourceUri);
_videoController = VideoPlayerController.networkUrl(sourceUri);
break;
}
_chewieController = ChewieController(
Expand Down
5 changes: 3 additions & 2 deletions test/elements/a_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ void main() {
),
),
);
expect(find.text("Hello, world!", findRichText: true), findsOneWidget);
final finder = find.textRange.ofSubstring("Hello, world!");
expect(finder, findsOne);
expect(tappedUrl, equals(""));
await tester.tap(find.text("Hello, world!", findRichText: true));
await tester.tapOnText(finder);
expect(tappedUrl, equals("https://example.com"));
});

Expand Down
0