56 lines
1.5 KiB
Dart
56 lines
1.5 KiB
Dart
|
|
import 'package:fcs/fcs/common/helpers/theme.dart';
|
||
|
|
import 'package:fcs/widget/img_url.dart';
|
||
|
|
import 'package:fcs/widget/local_text.dart';
|
||
|
|
import 'package:flutter/rendering.dart';
|
||
|
|
import 'package:flutter/widgets.dart';
|
||
|
|
|
||
|
|
Widget labeledText(BuildContext context, String text, String label,
|
||
|
|
{bool number = false}) {
|
||
|
|
final w = Container(
|
||
|
|
padding: EdgeInsets.only(top: 3, left: 10, bottom: 3, right: 10),
|
||
|
|
child: Column(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
|
children: <Widget>[
|
||
|
|
Padding(
|
||
|
|
padding: const EdgeInsets.only(top: 8.0),
|
||
|
|
child: LocalText(
|
||
|
|
context,
|
||
|
|
label,
|
||
|
|
fontSize: 14,
|
||
|
|
color: primaryColor,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
|
||
|
|
// number ? Spacer() : Container(),
|
||
|
|
Container(
|
||
|
|
padding: EdgeInsets.only(top: 10),
|
||
|
|
// alignment: number ? Alignment.topRight : null,
|
||
|
|
child: Text(
|
||
|
|
text == null ? "" : text,
|
||
|
|
style: textStyle,
|
||
|
|
maxLines: 3,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
);
|
||
|
|
return w;
|
||
|
|
}
|
||
|
|
|
||
|
|
Widget labeledImg(BuildContext context, String imgUrl, String label) {
|
||
|
|
final _labeledImg = Container(
|
||
|
|
padding: EdgeInsets.only(left: 10),
|
||
|
|
child: Row(children: <Widget>[
|
||
|
|
LocalText(context, label),
|
||
|
|
Padding(
|
||
|
|
padding: const EdgeInsets.only(left: 8.0),
|
||
|
|
child: ImageUrl(
|
||
|
|
url: imgUrl,
|
||
|
|
title: "Image",
|
||
|
|
),
|
||
|
|
),
|
||
|
|
]));
|
||
|
|
return _labeledImg;
|
||
|
|
}
|