Skip to content

Commit

Permalink
Update to font awesome version 6.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelspiss committed Mar 24, 2022
1 parent 2f71c7c commit 72590fe
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
package io.flutter.plugins;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.Log;

import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.PluginRegistry;

/**
* Generated file. Do not edit.
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
private static final String TAG = "GeneratedPluginRegistrant";
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
public static void registerWith(PluginRegistry registry) {
if (alreadyRegisteredWith(registry)) {
return;
}
}

private static boolean alreadyRegisteredWith(PluginRegistry registry) {
final String key = GeneratedPluginRegistrant.class.getCanonicalName();
if (registry.hasPlugin(key)) {
return true;
}
registry.registrarFor(key);
return false;
}
}
2 changes: 2 additions & 0 deletions example/lib/icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ final icons = <ExampleIcon>[
ExampleIcon(FontAwesomeIcons.chevronRight, 'chevronRight'),
ExampleIcon(FontAwesomeIcons.chevronUp, 'chevronUp'),
ExampleIcon(FontAwesomeIcons.child, 'child'),
ExampleIcon(FontAwesomeIcons.childDress, 'childDress'),
ExampleIcon(FontAwesomeIcons.childReaching, 'childReaching'),
ExampleIcon(FontAwesomeIcons.childRifle, 'childRifle'),
ExampleIcon(FontAwesomeIcons.children, 'children'),
ExampleIcon(FontAwesomeIcons.chrome, 'chrome'),
Expand Down
12 changes: 11 additions & 1 deletion lib/font_awesome_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export 'package:font_awesome_flutter/src/icon_data.dart';

// THIS FILE IS AUTOMATICALLY GENERATED!

/// Icons based on font awesome 6.1.0
/// Icons based on font awesome 6.1.1
class FontAwesomeIcons {
/// Solid 0 icon
///
Expand Down Expand Up @@ -2289,6 +2289,16 @@ class FontAwesomeIcons {
/// https://fontawesome.com/icons/child?style=solid
static const IconData child = IconDataSolid(0xf1ae);

/// Solid Child Dress icon
///
/// https://fontawesome.com/icons/child-dress?style=solid
static const IconData childDress = IconDataSolid(0xe59c);

/// Solid Child Reaching icon
///
/// https://fontawesome.com/icons/child-reaching?style=solid
static const IconData childReaching = IconDataSolid(0xe59d);

/// Solid Child Rifle icon
///
/// https://fontawesome.com/icons/child-rifle?style=solid
Expand Down
Binary file modified lib/fonts/fa-brands-400.ttf
Binary file not shown.
Binary file modified lib/fonts/fa-regular-400.ttf
Binary file not shown.
Binary file modified lib/fonts/fa-solid-900.ttf
Binary file not shown.
26 changes: 15 additions & 11 deletions lib/src/fa_icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class FaIcon extends StatelessWidget {
///
/// The [size] and [color] default to the value given by the current [IconTheme].
const FaIcon(
this.icon, {
Key? key,
this.size,
this.color,
this.semanticLabel,
this.textDirection,
}) : super(key: key);
this.icon, {
Key? key,
this.size,
this.color,
this.semanticLabel,
this.textDirection,
}) : super(key: key);

/// The icon to display. Available icons are listed in [FontAwesomeIcons].
///
Expand Down Expand Up @@ -105,7 +105,8 @@ class FaIcon extends StatelessWidget {
@override
Widget build(BuildContext context) {
assert(this.textDirection != null || debugCheckHasDirectionality(context));
final TextDirection textDirection = this.textDirection ?? Directionality.of(context);
final TextDirection textDirection =
this.textDirection ?? Directionality.of(context);

final IconThemeData iconTheme = IconTheme.of(context);

Expand All @@ -125,8 +126,10 @@ class FaIcon extends StatelessWidget {
}

Widget iconWidget = RichText(
overflow: TextOverflow.visible, // Never clip.
textDirection: textDirection, // Since we already fetched it for the assert...
overflow: TextOverflow.visible,
// Never clip.
textDirection: textDirection,
// Since we already fetched it for the assert...
text: TextSpan(
text: String.fromCharCode(icon!.codePoint),
style: TextStyle(
Expand Down Expand Up @@ -165,7 +168,8 @@ class FaIcon extends StatelessWidget {
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(IconDataProperty('icon', icon, ifNull: '<empty>', showName: false));
properties.add(
IconDataProperty('icon', icon, ifNull: '<empty>', showName: false));
properties.add(DoubleProperty('size', size, defaultValue: null));
properties.add(ColorProperty('color', color, defaultValue: null));
}
Expand Down
17 changes: 11 additions & 6 deletions test/fa_icon_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ void main() {
expect(text.text.style!.color, const Color(0xFF666666).withOpacity(0.5));
});

testWidgets('Icon sizing - no theme, default size', (WidgetTester tester) async {
testWidgets('Icon sizing - no theme, default size',
(WidgetTester tester) async {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
Expand All @@ -38,7 +39,8 @@ void main() {
expect(renderObject.size, equals(const Size.square(24.0)));
});

testWidgets('Icon sizing - no theme, explicit size', (WidgetTester tester) async {
testWidgets('Icon sizing - no theme, explicit size',
(WidgetTester tester) async {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
Expand Down Expand Up @@ -72,7 +74,8 @@ void main() {
expect(renderObject.size, equals(const Size.square(36.0)));
});

testWidgets('Icon sizing - sized theme, explicit size', (WidgetTester tester) async {
testWidgets('Icon sizing - sized theme, explicit size',
(WidgetTester tester) async {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
Expand All @@ -92,7 +95,8 @@ void main() {
expect(renderObject.size, equals(const Size.square(48.0)));
});

testWidgets('Icon sizing - sizeless theme, default size', (WidgetTester tester) async {
testWidgets('Icon sizing - sizeless theme, default size',
(WidgetTester tester) async {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
Expand All @@ -109,7 +113,8 @@ void main() {
expect(renderObject.size, equals(const Size.square(24.0)));
});

testWidgets("Changing semantic label from null doesn't rebuild tree ", (WidgetTester tester) async {
testWidgets("Changing semantic label from null doesn't rebuild tree ",
(WidgetTester tester) async {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
Expand Down Expand Up @@ -139,4 +144,4 @@ void main() {
// semanticLabel to make sure the subtree was not rebuilt.
expect(richText2, same(richText1));
});
}
}

0 comments on commit 72590fe

Please sign in to comment.