import 'package:test_sa/models/service_request/service_request.dart'; import 'package:test_sa/models/lookup.dart'; import 'package:test_sa/views/app_style/colors.dart'; import 'package:test_sa/views/app_style/sizing.dart'; import 'package:flutter/material.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, ), ) ); } }