You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/views/widgets/requests/info_row.dart

74 lines
2.1 KiB
Dart

3 years ago
import 'package:flutter/material.dart';
import 'package:test_sa/views/app_style/sizing.dart';
3 years ago
class RequestInfoRow extends StatelessWidget {
final String title;
final String info;
final String content;
final Widget contentWidget;
final Widget infoWidget;
const RequestInfoRow({Key key, this.title, this.info,this.content, this.contentWidget, this.infoWidget}) : super(key: key);
@override
Widget build(BuildContext context) {
if(info != null && info.isEmpty){
return SizedBox.shrink();
}
if(content != null && content.isEmpty){
return SizedBox.shrink();
}
return Column(
children: [
Row(
children: [
Text(
title + " : ",
style: Theme.of(context).textTheme.subtitle2.copyWith(
//fontSize: 12
),
textScaleFactor: AppStyle.getScaleFactor(context),
),
if(info != null)
Expanded(
child: Text(
info,
style: Theme.of(context).textTheme.bodyText2,
textAlign: TextAlign.right,
textScaleFactor: AppStyle.getScaleFactor(context),
),
),
if(infoWidget != null)
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
infoWidget,
],
),
),
],
),
if(content != null)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row(
children: [
Expanded(
child: Text(
content ?? 'No data found',
style: Theme.of(context).textTheme.bodyText2,
textAlign: TextAlign.center,
textScaleFactor: AppStyle.getScaleFactor(context),
),
),
],
),
),
if(contentWidget != null)
contentWidget,
Divider(color: Theme.of(context).primaryColor,),
],
);
}
}