1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-19 03:33:42 +01:00
git-touch-android-ios-app/lib/widgets/label.dart
2020-01-12 15:50:33 +08:00

30 lines
718 B
Dart

import 'package:flutter/material.dart';
import 'package:git_touch/utils/utils.dart';
class Label extends StatelessWidget {
final String name;
final String cssColor;
Label({this.name, this.cssColor});
@override
Widget build(BuildContext context) {
final color = convertColor(cssColor);
return Container(
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 6),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.all(Radius.circular(4)),
),
child: Text(
name,
style: TextStyle(
fontSize: 12,
color: getFontColorByBrightness(color),
fontWeight: FontWeight.w600,
),
),
);
}
}