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.
uco-mobile-poc/lib/app/modules/faqs/views/faqs_first_screen_view.dart

112 lines
4.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../core/constants/translation_keys.dart';
import '../../../custom_widgets/custom_app_bar.dart';
import '../../../res/app_colors.dart';
import '../../../routes/app_pages.dart';
import '../controllers/faqs_controller.dart';
import '../controllers/faqs_first_screen_controller.dart';
class FaqsFirstScreenView extends GetView<FaqsController> {
FaqsFirstScreenView({Key? key, this.description, this.title, this.shortTitle}) : super(key: key);
var firstScreenController = Get.find<FaqsFirstController>();
String? title;
String? shortTitle;
String? description;
@override
Widget build(BuildContext context) {
var faqs = controller.faqsModel;
return Scaffold(
appBar: DashBoardAppBar(
title: TranslationKeys.makeTranslation(TranslationKeys.textFaqs),
onBackButtonPressed: () {
Get.back();
},
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(firstScreenController.sendMoney.title, style: Theme
.of(context)
.textTheme
.titleSmall
?.copyWith(color: AppColors.black, fontSize: 20, fontWeight: FontWeight.w500)),
Column(children: [
Container(
margin: const EdgeInsets.only(left: 0, right: 0, bottom: 12, top: 17),
height: 40,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(20.0),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(Icons.search, size: 15.0, color: Colors.grey[800]),
const SizedBox(width: 5.0),
Expanded(
child: TextField(
style: Theme
.of(context)
.textTheme
.bodySmall
?.copyWith(fontWeight: FontWeight.w400, fontSize: 12),
decoration: const InputDecoration(
enabledBorder: InputBorder.none,
border: InputBorder.none,
focusedBorder: InputBorder.none,
hintText: 'search your query',
),
onChanged: (value) => firstScreenController.searchText.value = value),
),
],
),
),
]),
const SizedBox(height: 20),
Obx(() {
return Expanded(
child: ListView.builder(
itemCount: firstScreenController.filteredListQuestions.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: InkWell(
onTap: () {
Get.toNamed(Routes.FAQS_SECOND_SCREEN, arguments: firstScreenController.sendMoney.questions[index]);
},
child: Padding(
padding: const EdgeInsets.only(bottom: 10.0),
child: Row(
children: [
Text(
firstScreenController.filteredListQuestions[index].title,
style: context.textTheme.bodySmall!.copyWith(fontSize: 14, fontWeight: FontWeight.w500),
),
const Spacer(),
const Padding(padding: EdgeInsets.all(0.0), child: Icon(Icons.arrow_forward_ios_outlined, size: 15, color: AppColors.colorGrey500)),
],
),
),
),
);
},
),
);
}),
],
),
),
);
}
}