You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/old_lib/views/widgets/requests/request_status.dart

40 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import '../../app_style/colors.dart';
import '../../app_style/sizing.dart';
class StatusLabel extends StatelessWidget {
final String? label;
final Color? color;
const StatusLabel({
Key? key,
this.label,
this.color,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 8),
alignment: Alignment.center,
decoration: BoxDecoration(
color: color ?? Colors.green,
borderRadius: BorderRadius.circular(
AppStyle.getBorderRadius(context),
),
boxShadow: const [AppStyle.boxShadow],
),
child: Text(
label ?? "no status",
style: Theme.of(context).textTheme.titleSmall?.copyWith(
color: color != null
? color!.computeLuminance() > 0.5
? AColors.black
: Colors.white
: null,
),
));
}
}