Skip to content

Commit 35245cc

Browse files
authored
Remove package fwfh_text_style (#1009)
1 parent ecf49e4 commit 35245cc

File tree

32 files changed

+44
-914
lines changed

32 files changed

+44
-914
lines changed

.github/workflows/backward_compatibility.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ jobs:
9090
- stable
9191

9292
# In case one of these fails, create a new PR against the `release/*` branch
93-
# and publish a new version to make sure there is a compatible version
94-
# of `fwfh_text_style` for all active Flutter versions.
9593
name: core@${{ matrix.channel }}
9694
runs-on: ubuntu-latest
9795
continue-on-error: true

demo_app/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
/build/
3333

3434
# Web related
35-
lib/generated_plugin_registrant.dart
3635

3736
# Symbolication related
3837
app.*.symbols

demo_app/pubspec.lock

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,6 @@ packages:
316316
relative: true
317317
source: path
318318
version: "0.8.0+2"
319-
fwfh_text_style:
320-
dependency: "direct overridden"
321-
description:
322-
path: "../packages/fwfh_text_style"
323-
relative: true
324-
source: path
325-
version: "2.22.8+2"
326319
fwfh_url_launcher:
327320
dependency: "direct overridden"
328321
description:

demo_app/pubspec.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ dependency_overrides:
3434
path: ../packages/fwfh_just_audio
3535
fwfh_svg:
3636
path: ../packages/fwfh_svg
37-
fwfh_text_style:
38-
path: ../packages/fwfh_text_style
3937
fwfh_url_launcher:
4038
path: ../packages/fwfh_url_launcher
4139
fwfh_webview:

packages/core/lib/src/core_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import 'package:csslib/visitor.dart' as css;
22
import 'package:flutter/widgets.dart';
3-
import 'package:fwfh_text_style/fwfh_text_style.dart';
43
import 'package:html/dom.dart' as dom;
54

65
import 'core_helpers.dart';
76

87
part 'data/build_bits.dart';
98
part 'data/css.dart';
109
part 'data/image.dart';
10+
part 'data/normal_line_height.dart';
1111
part 'data/text_style.dart';
1212

1313
/// A building element metadata.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
part of '../core_data.dart';
2+
3+
class NormalLineHeight {
4+
final double? value;
5+
6+
const NormalLineHeight(this.value);
7+
}

packages/core/lib/src/data/text_style.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class TextStyleHtml {
3232
/// Creates the root text style.
3333
factory TextStyleHtml.root(Iterable<dynamic> deps, TextStyle? widgetStyle) {
3434
var style = _getDependency<TextStyle>(deps).merge(widgetStyle);
35-
style = FwfhTextStyle.from(style);
3635

3736
final mqd = _getDependency<MediaQueryData>(deps);
3837
final tsf = mqd.textScaleFactor;
@@ -42,7 +41,10 @@ class TextStyleHtml {
4241
}
4342

4443
return TextStyleHtml._(
45-
deps: deps,
44+
deps: [
45+
...deps,
46+
NormalLineHeight(style.height),
47+
],
4648
style: style,
4749
textDirection: _getDependency<TextDirection>(deps),
4850
whitespace: CssWhitespace.normal,

packages/core/lib/src/internal/ops/text_style.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ class TextStyleOps {
8080
}
8181

8282
if (height == -1) {
83-
// ignore: avoid_redundant_argument_values
84-
return p.copyWith(style: p.style.copyWith(height: null));
83+
final normal = p.getDependency<NormalLineHeight>();
84+
return p.copyWith(style: p.style.copyWith(height: normal.value));
8585
}
8686

8787
return p.copyWith(style: p.style.copyWith(height: height));

packages/core/pubspec.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@ dependencies:
1111
csslib: ">=0.17.0 <2.0.0"
1212
flutter:
1313
sdk: flutter
14-
fwfh_text_style: ^2.22.08+1
1514
html: ^0.15.0
1615

17-
dependency_overrides:
18-
fwfh_text_style:
19-
path: ../fwfh_text_style
20-
2116
dev_dependencies:
2217
flutter_test:
2318
sdk: flutter

packages/core/test/_.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Future<String> explain(
2929
WidgetTester tester,
3030
String? html, {
3131
String? Function(Explainer, Widget)? explainer,
32+
double? height,
3233
Widget? hw,
3334
GlobalKey? key,
3435
bool rtl = false,
@@ -61,6 +62,7 @@ Future<String> explain(
6162
color: kColor,
6263
fontSize: 10.0,
6364
fontWeight: FontWeight.normal,
65+
height: height,
6466
),
6567
child: Directionality(
6668
textDirection: rtl ? TextDirection.rtl : TextDirection.ltr,

0 commit comments

Comments
 (0)