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.
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:test_sa/views/app_style/colors.dart';
|
|
|
|
|
import 'package:test_sa/views/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: EdgeInsets.symmetric(vertical: 2,horizontal: 8),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: color ?? Colors.green,
|
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
|
AppStyle.getBorderRadius(context)
|
|
|
|
|
),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
AppStyle.boxShadow
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
label ?? "no status",
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
|
|
|
color: color.computeLuminance() > 0.5
|
|
|
|
|
? AColors.black : Colors.white,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|