clean up
This commit is contained in:
56
lib/pages/widgets/label_widgets.dart
Normal file
56
lib/pages/widgets/label_widgets.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'img_url.dart';
|
||||
import '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: 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;
|
||||
}
|
||||
Reference in New Issue
Block a user