add structure
This commit is contained in:
46
lib/widget/label_widgets.dart
Normal file
46
lib/widget/label_widgets.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/widget/img_url.dart';
|
||||
import 'package:fcs/widget/local_text.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: Wrap(
|
||||
alignment: number ? WrapAlignment.spaceBetween : WrapAlignment.start,
|
||||
// scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
LocalText(context, label),
|
||||
// number ? Spacer() : Container(),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 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;
|
||||
}
|
||||
Reference in New Issue
Block a user