70 lines
1.8 KiB
Dart
70 lines
1.8 KiB
Dart
import 'package:fcs/fcs/common/helpers/theme.dart';
|
|
import 'package:fcs/fcs/common/pages/model/language_model.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
class DisplayText extends StatelessWidget {
|
|
final String text;
|
|
final String labelText;
|
|
final IconData iconData;
|
|
final int maxLines;
|
|
final bool withBorder;
|
|
final Color borderColor;
|
|
|
|
const DisplayText({
|
|
Key key,
|
|
this.text,
|
|
this.labelText,
|
|
this.iconData,
|
|
this.maxLines = 1,
|
|
this.withBorder = false,
|
|
this.borderColor,
|
|
}) : super(key: key);
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var languageModel = Provider.of<LanguageModel>(context);
|
|
|
|
var labelStyle = languageModel.isEng
|
|
? TextStyle(
|
|
color: Colors.black54,
|
|
)
|
|
: TextStyle(color: Colors.black54, fontFamily: "Myanmar3");
|
|
var textStyle = languageModel.isEng
|
|
? TextStyle(
|
|
color: primaryColor,
|
|
)
|
|
: TextStyle(color: primaryColor, fontFamily: "Myanmar3");
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.only(top: 8.0, bottom: 8),
|
|
child: Row(
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Icon(
|
|
iconData,
|
|
color: primaryColor,
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
labelText,
|
|
style: labelStyle,
|
|
),
|
|
Text(
|
|
text,
|
|
style: textStyle,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|