Files
fcs/lib/pages/faq/widgets.dart

105 lines
3.4 KiB
Dart
Raw Normal View History

2020-10-07 02:33:06 +06:30
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:flutter/material.dart';
Widget itemTitle(BuildContext context, String textKey) {
return Padding(
padding: const EdgeInsets.only(left: 18.0, top: 15, bottom: 0),
child: Text(
2021-09-10 14:29:55 +06:30
AppTranslations.of(context)!.text(textKey),
2020-10-07 02:33:06 +06:30
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 18, color: Colors.black),
),
);
}
2024-01-23 16:28:08 +06:30
Widget subItemTitle(BuildContext context, String textKey,
{IconData? iconData}) {
2020-10-07 02:33:06 +06:30
return Padding(
padding: const EdgeInsets.only(left: 0, top: 0, bottom: 0),
child: Row(
children: [
Icon(
iconData,
color: primaryColor,
),
SizedBox(width: 10),
Text(
2021-09-10 14:29:55 +06:30
AppTranslations.of(context)!.text(textKey),
2020-10-07 02:33:06 +06:30
style: TextStyle(
fontWeight: FontWeight.w700, fontSize: 15, color: primaryColor),
),
],
),
);
}
Widget contactItem(BuildContext context, String text, IconData iconData,
2021-09-10 14:29:55 +06:30
{Function()? onTap, String? labelKey}) {
2020-10-07 02:33:06 +06:30
return Material(
child: Padding(
padding: const EdgeInsets.only(left: 18.0, bottom: 10, right: 18),
child: Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 0.8),
borderRadius: BorderRadius.all(
Radius.circular(5.0) // <--- border radius here
),
),
child: InkWell(
onTap: () => onTap != null ? onTap() : null,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
iconData,
color: primaryColor,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
labelKey == null
? Container()
: Padding(
padding: EdgeInsets.fromLTRB(10, 10, 10, 0),
child: LocalText(context, labelKey,
color: primaryColor,
fontWeight: FontWeight.w500,
fontSize: 18),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
2024-01-23 16:28:08 +06:30
text,
2020-10-07 02:33:06 +06:30
overflow: TextOverflow.ellipsis,
maxLines: 5,
style: TextStyle(
fontSize: 14.0,
),
),
),
],
),
SizedBox(
width: 5,
),
onTap == null
? Container()
: Icon(
Icons.open_in_new,
color: Colors.grey,
size: 15,
)
],
),
)),
),
),
);
}