Flutter Fixes etc
This commit is contained in:
@@ -1,85 +1,12 @@
|
||||
library font_awesome_flutter;
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
/// [IconData] for a font awesome brand icon from a code point
|
||||
///
|
||||
/// Code points can be obtained from fontawesome.com
|
||||
class IconDataBrands extends IconData {
|
||||
const IconDataBrands(int codePoint)
|
||||
: super(
|
||||
codePoint,
|
||||
fontFamily: 'FontAwesomeBrands',
|
||||
fontPackage: 'font_awesome_flutter',
|
||||
);
|
||||
}
|
||||
|
||||
/// [IconData] for a font awesome solid icon from a code point
|
||||
///
|
||||
/// Code points can be obtained from fontawesome.com
|
||||
class IconDataSolid extends IconData {
|
||||
const IconDataSolid(int codePoint)
|
||||
: super(
|
||||
codePoint,
|
||||
fontFamily: 'FontAwesomeSolid',
|
||||
fontPackage: 'font_awesome_flutter',
|
||||
);
|
||||
}
|
||||
|
||||
/// [IconData] for a font awesome regular icon from a code point
|
||||
///
|
||||
/// Code points can be obtained from fontawesome.com
|
||||
class IconDataRegular extends IconData {
|
||||
const IconDataRegular(int codePoint)
|
||||
: super(
|
||||
codePoint,
|
||||
fontFamily: 'FontAwesomeRegular',
|
||||
fontPackage: 'font_awesome_flutter',
|
||||
);
|
||||
}
|
||||
|
||||
/// [IconData] for a font awesome light icon from a code point. Only works if
|
||||
/// light icons (font awesome pro) have been installed.
|
||||
///
|
||||
/// Code points can be obtained from fontawesome.com
|
||||
class IconDataLight extends IconData {
|
||||
const IconDataLight(int codePoint)
|
||||
: super(
|
||||
codePoint,
|
||||
fontFamily: 'FontAwesomeLight',
|
||||
fontPackage: 'font_awesome_flutter',
|
||||
);
|
||||
}
|
||||
|
||||
/// [IconData] for a font awesome duotone icon from a code point. Only works if
|
||||
/// duotone icons (font awesome pro) have been installed.
|
||||
///
|
||||
/// Code points can be obtained from fontawesome.com. Each duotone icon consists
|
||||
/// of a primary [codePoint] and a [secondary].
|
||||
class IconDataDuotone extends IconData {
|
||||
/// Secondary glyph of the duotone icon
|
||||
///
|
||||
/// Due to tree-shaking restraints [secondary] cannot be the codepoint itself,
|
||||
/// but has to be an [IconData] object.
|
||||
final IconData? secondary;
|
||||
|
||||
const IconDataDuotone(int codePoint, {this.secondary})
|
||||
: super(
|
||||
codePoint,
|
||||
fontFamily: 'FontAwesomeDuotone',
|
||||
fontPackage: 'font_awesome_flutter',
|
||||
);
|
||||
}
|
||||
|
||||
/// [IconData] for a font awesome thin icon from a code point. Only works if
|
||||
/// thin icons (font awesome pro, v6+) have been installed.
|
||||
///
|
||||
/// Code points can be obtained from fontawesome.com
|
||||
class IconDataThin extends IconData {
|
||||
const IconDataThin(int codePoint)
|
||||
: super(
|
||||
codePoint,
|
||||
fontFamily: 'FontAwesomeThin',
|
||||
fontPackage: 'font_awesome_flutter',
|
||||
);
|
||||
}
|
||||
// NOTE:
|
||||
// This file previously declared IconDataBrands / IconDataSolid / IconDataRegular
|
||||
// / IconDataLight / IconDataThin / IconDataDuotone as subclasses of [IconData].
|
||||
// Newer Flutter SDKs mark [IconData] as a `final class`, which can no longer be
|
||||
// extended outside its own library, so those subclasses no longer compile.
|
||||
//
|
||||
// The generated icon constants in `font_awesome_flutter.dart` now construct
|
||||
// plain `const IconData(..., fontFamily: '<FontAwesome...>', fontPackage:
|
||||
// 'font_awesome_flutter')` directly, so these helper subclasses are no longer
|
||||
// needed. Using const [IconData] literals also keeps icon tree-shaking working.
|
||||
|
||||
Reference in New Issue
Block a user