qhd-prevention-flutter/lib/tools/SmallWidget.dart

25 lines
621 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import 'dart:ffi';
import 'package:flutter/material.dart';
import 'h_colors.dart';
/// 标签eg:风险等级)
Widget riskTagText(int level, String title) {
final List<Color> colors = riskLevelTextColors();
if (colors.length <= (level - 1)) {
return SizedBox();
}
return Container(
padding: EdgeInsets.symmetric(vertical: 3, horizontal: 5),
decoration: BoxDecoration(
color: colors[level-1],
borderRadius: const BorderRadius.all(Radius.circular(5)),
),
// color: Colors.,
child: Text(
title,
style: TextStyle(color: Colors.white, fontSize: 14),
),
);
}