mirror of
https://github.com/LinwoodDev/Butterfly.git
synced 2025-08-18 04:20:25 +08:00
25 lines
720 B
Dart
25 lines
720 B
Dart
import 'package:butterfly_api/butterfly_api.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:material_leap/material_leap.dart';
|
|
import 'package:phosphor_flutter/phosphor_flutter.dart';
|
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|
|
|
extension PathShapeVisualizer on PathShape {
|
|
IconGetter get icon {
|
|
return map(
|
|
circle: (_) => PhosphorIcons.circle,
|
|
rectangle: (_) => PhosphorIcons.square,
|
|
line: (_) => PhosphorIcons.lineSegment,
|
|
);
|
|
}
|
|
|
|
String getLocalizedName(BuildContext context) {
|
|
final loc = AppLocalizations.of(context);
|
|
return map(
|
|
circle: (_) => loc.circle,
|
|
rectangle: (_) => loc.rectangle,
|
|
line: (_) => loc.line,
|
|
);
|
|
}
|
|
}
|