clean up
This commit is contained in:
75
lib/pages/widgets/display_text.dart
Normal file
75
lib/pages/widgets/display_text.dart
Normal file
@@ -0,0 +1,75 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/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;
|
||||
final Widget icon;
|
||||
|
||||
const DisplayText({
|
||||
Key key,
|
||||
this.text,
|
||||
this.labelText,
|
||||
this.iconData,
|
||||
this.maxLines = 1,
|
||||
this.withBorder = false,
|
||||
this.borderColor,
|
||||
this.icon,
|
||||
}) : 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: [
|
||||
iconData == null
|
||||
? icon == null ? Container() : icon
|
||||
: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Icon(
|
||||
iconData,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
labelText == null
|
||||
? Container()
|
||||
: Text(
|
||||
labelText,
|
||||
style: labelStyle,
|
||||
),
|
||||
Text(
|
||||
text,
|
||||
style: textStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user