added form design for installation and pullout, handle pullout type task and other improvements
parent
4f9f76515d
commit
bfb2685c55
@ -0,0 +1,87 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:test_sa/controllers/api_routes/urls.dart';
|
||||||
|
import 'package:test_sa/extensions/context_extension.dart';
|
||||||
|
import 'package:test_sa/extensions/int_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/string_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/text_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
||||||
|
import 'package:test_sa/modules/loan_module/models/loan_request_model.dart';
|
||||||
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
||||||
|
import 'package:test_sa/views/widgets/images/files_list.dart';
|
||||||
|
|
||||||
|
class InstallationDetailsView extends StatelessWidget {
|
||||||
|
final LoanRequestModel loanData;
|
||||||
|
|
||||||
|
const InstallationDetailsView({super.key, required this.loanData});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
detailContent(
|
||||||
|
context: context,
|
||||||
|
heading: 'Updates SN:',
|
||||||
|
label: loanData.installationDate??'-'
|
||||||
|
),
|
||||||
|
detailContent(
|
||||||
|
context: context,
|
||||||
|
heading: 'Installation Date',
|
||||||
|
label: loanData.installationDate??'-'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
12.height,
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
detailContent(
|
||||||
|
context: context,
|
||||||
|
heading: 'Start Time',
|
||||||
|
label: loanData.installationDate??'-'
|
||||||
|
),
|
||||||
|
detailContent(
|
||||||
|
context: context,
|
||||||
|
heading: 'End Time',
|
||||||
|
label: loanData.installationDate??'-'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
12.height,
|
||||||
|
detailContent(
|
||||||
|
context: context,
|
||||||
|
heading: 'Total Time',
|
||||||
|
label: loanData.installationDate??'-'
|
||||||
|
),
|
||||||
|
if (loanData.loanAttachments!.isNotEmpty) ...[
|
||||||
|
12.height,
|
||||||
|
Text(
|
||||||
|
"Uploads Phase 2 docs".addTranslation,
|
||||||
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
FilesList(images: loanData.loanAttachments?.map((e) => URLs.getFileUrl(e.attachmentName ?? '') ?? '').toList() ?? []),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
).toShadowContainer(context, borderRadius: 20),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget detailContent({required BuildContext context, required String label, required String heading}) {
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
heading.bodyText(context).custom(color: AppColor.neutral120),
|
||||||
|
6.height,
|
||||||
|
//TODO Need to check which value need to show here
|
||||||
|
label.bodyText(context).custom(color: AppColor.neutral120),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:test_sa/extensions/context_extension.dart';
|
||||||
|
import 'package:test_sa/extensions/int_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/string_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/text_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
||||||
|
import 'package:test_sa/modules/loan_module/models/loan_request_model.dart';
|
||||||
|
import 'package:test_sa/modules/loan_module/pages/installation_pullout_form_view.dart';
|
||||||
|
import 'package:test_sa/modules/loan_module/pages/intallation_details_view.dart';
|
||||||
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
||||||
|
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
||||||
|
|
||||||
|
class PullOutDetailsPage extends StatefulWidget {
|
||||||
|
final LoanRequestModel? loanData;
|
||||||
|
|
||||||
|
PullOutDetailsPage({Key? key, required this.loanData}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_PullOutDetailsPageState createState() {
|
||||||
|
return _PullOutDetailsPageState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PullOutDetailsPageState extends State<PullOutDetailsPage> {
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
appBar: DefaultAppBar(
|
||||||
|
title: 'Loan Request'.addTranslation,
|
||||||
|
),
|
||||||
|
body: DefaultTabController(
|
||||||
|
length: 2,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 16.toScreenWidth, right: 16.toScreenWidth, top: 12.toScreenHeight),
|
||||||
|
decoration: BoxDecoration(color: context.isDark ? AppColor.neutral50 : AppColor.white10, borderRadius: BorderRadius.circular(10)),
|
||||||
|
child: TabBar(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 4.toScreenHeight, horizontal: 4.toScreenWidth),
|
||||||
|
labelColor: context.isDark ? AppColor.neutral30 : AppColor.black20,
|
||||||
|
unselectedLabelColor: context.isDark ? AppColor.neutral30 : AppColor.black20,
|
||||||
|
unselectedLabelStyle: AppTextStyles.bodyText,
|
||||||
|
labelStyle: AppTextStyles.bodyText,
|
||||||
|
indicatorPadding: EdgeInsets.zero,
|
||||||
|
indicatorSize: TabBarIndicatorSize.tab,
|
||||||
|
dividerColor: Colors.transparent,
|
||||||
|
indicator: BoxDecoration(color: context.isDark ? AppColor.neutral60 : AppColor.neutral110, borderRadius: BorderRadius.circular(7)),
|
||||||
|
onTap: (index) {
|
||||||
|
// setState(() {});
|
||||||
|
},
|
||||||
|
tabs: [
|
||||||
|
Tab(text: 'Installation'.addTranslation, height: 57.toScreenHeight),
|
||||||
|
Tab(text: 'Pull Out'.addTranslation, height: 57.toScreenHeight),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
12.height,
|
||||||
|
TabBarView(
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.topCenter,
|
||||||
|
child: InstallationDetailsView(
|
||||||
|
loanData: widget.loanData!,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const InstallationPullOutFormView(isPullout: true),
|
||||||
|
],
|
||||||
|
).expanded,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue