chip static method
Implementation
static String chip() => r'''
import 'package:flutter/material.dart';
import '../tokens/app_radius.dart';
import '../tokens/app_spacing.dart';
import '../tokens/app_typography.dart';
import 'app_surface.dart';
class AppChip extends StatelessWidget {
const AppChip({
super.key,
required this.label,
this.selected = false,
this.onTap,
});
final String label;
final bool selected;
final VoidCallback? onTap;
@override
Widget build(BuildContext context) {
return AppSurface(
depth: selected ? AppSurfaceDepth.pressed : AppSurfaceDepth.raised,
radius: AppRadius.pill,
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.md,
vertical: AppSpacing.xs,
),
onTap: onTap,
semanticLabel: label,
child: Text(label, style: AppTypography.label),
);
}
}
''';