init method
Future<int?>
init({
- required String name,
- required FontWeight weight,
- required Color color,
- required double size,
override
Implementation
@override
Future<int?> init({
required String name,
required FontWeight weight,
required Color color,
required double size,
}) async {
final hexColor =
color.value.toRadixString(16).padLeft(8, '0').toUpperCase();
try {
final result = await methodChannel.invokeMethod('init', {
'name': name,
'weight': weight.index + 1,
'color': '#$hexColor',
'size': size,
});
return result[idKey];
} catch (e) {
if (kDebugMode) print('SfSymbols init: $e');
return null;
}
}