150 lines
4.4 KiB
Dart
150 lines
4.4 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:ftc_mobile_app/models/training/TrainingResponseData.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
class TrainingDetailScreenArgs {
|
|
final TrainingUsers data;
|
|
|
|
TrainingDetailScreenArgs({required this.data});
|
|
}
|
|
|
|
class TrainingDetailScreen extends StatefulWidget {
|
|
final TrainingDetailScreenArgs args;
|
|
|
|
const TrainingDetailScreen({super.key, required this.args});
|
|
|
|
@override
|
|
State<TrainingDetailScreen> createState() => _TrainingDetailScreenState();
|
|
}
|
|
|
|
class _TrainingDetailScreenState extends State<TrainingDetailScreen> {
|
|
ProposedTrainings? get _data => widget.args.data.trainingId;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return CustomScaffold(
|
|
backgroundColor: CustomAppColors.kWhiteColor,
|
|
screenKey: GlobalKey(),
|
|
onScreenTap: Get.focusScope?.unfocus,
|
|
showAppBar: true,
|
|
appBar: AppBar(
|
|
automaticallyImplyLeading: false,
|
|
title: CustomTextWidget(
|
|
text: "${_data?.prpsTrgType?.capitalizeFirst ?? ""} Training",
|
|
fontColor: Colors.white,
|
|
textAlign: TextAlign.left,
|
|
),
|
|
backgroundColor: Theme.of(context).primaryColor,
|
|
centerTitle: false,
|
|
actions: const [
|
|
CloseButton(color: Colors.white),
|
|
],
|
|
),
|
|
body: SafeArea(
|
|
child: ListView(
|
|
padding: REdgeInsets.symmetric(horizontal: 20),
|
|
children: [
|
|
16.verticalSpace,
|
|
_headerValueWidget(
|
|
heading: 'Training Title',
|
|
value: _data?.prpsName ?? "",
|
|
),
|
|
16.verticalSpace,
|
|
_headerValueWidget(
|
|
heading: 'Introduction',
|
|
value: _data?.prpsDescription ?? "",
|
|
),
|
|
16.verticalSpace,
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: _headerValueWidget(
|
|
heading: 'Training Start Date',
|
|
value: DateFormatter.dateFormatter2.format(
|
|
DateTime.fromMillisecondsSinceEpoch(
|
|
_data?.prpsTrgStartDate ?? 0)),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: _headerValueWidget(
|
|
heading: 'Training End Date',
|
|
value: DateFormatter.dateFormatter2.format(
|
|
DateTime.fromMillisecondsSinceEpoch(
|
|
_data?.prpsTrgEndDate ?? 0)),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
16.verticalSpace,
|
|
_headerValueWidget(
|
|
heading: 'Training Registration Date',
|
|
value: DateFormatter.dateFormatter2.format(
|
|
DateTime.fromMillisecondsSinceEpoch(
|
|
_data?.prpsTrgRegisterationDate ?? 0)),
|
|
),
|
|
16.verticalSpace,
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: _headerValueWidget(
|
|
heading: 'Training Type',
|
|
value: _data?.prpsTrgType?.capitalizeFirst ?? "",
|
|
),
|
|
),
|
|
12.horizontalSpace,
|
|
Expanded(
|
|
child: _headerValueWidget(
|
|
heading: 'Training Type',
|
|
value: _data?.prpsTrgClass?.capitalizeFirst ?? "",
|
|
),
|
|
),
|
|
],
|
|
),
|
|
16.verticalSpace,
|
|
_headerValueWidget(
|
|
heading: 'Training Status',
|
|
value: _data?.prpsTrgStatus?.capitalizeFirst ?? "",
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _headerValueWidget({required String heading, required String value}) {
|
|
return Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
_heading(heading),
|
|
3.verticalSpace,
|
|
_subtext(value),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _heading(String text) {
|
|
return Text(
|
|
text,
|
|
style: TextStyle(
|
|
fontSize: 14.sp,
|
|
fontWeight: FontWeight.w700,
|
|
color: Colors.black,
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _subtext(String text) {
|
|
return Text(
|
|
text,
|
|
style: TextStyle(
|
|
fontSize: 12.sp,
|
|
fontWeight: FontWeight.w400,
|
|
),
|
|
);
|
|
}
|
|
}
|