|
|
@@ -12,7 +12,6 @@ import 'package:telnow_mobile_new/src/layouts/mobile/history_rating.dart';
|
|
|
import 'package:telnow_mobile_new/src/utils/U.dart';
|
|
|
import 'package:telnow_mobile_new/src/utils/dio_logging_interceptors.dart';
|
|
|
import 'package:telnow_mobile_new/src/utils/provider.dart';
|
|
|
-import 'package:telnow_mobile_new/src/utils/ui_service.dart';
|
|
|
|
|
|
class MobHistoryPage extends StatefulWidget {
|
|
|
const MobHistoryPage({super.key});
|
|
|
@@ -26,6 +25,7 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
late AnimationController _animationController;
|
|
|
late final HistoryModule historyModule;
|
|
|
late final UserModule userModule;
|
|
|
+ final List<String> pages = ['ongoing::none', 'ongoing::queue', 'ongoing::done', 'ongoing::hold', 'done::none', 'done::finish', 'done::cancel'];
|
|
|
|
|
|
var rating = [
|
|
|
{'key': 1, 'image': "assets/image/icon/very_dissatisfied.png", 'label': 'disatisfied'.tr()},
|
|
|
@@ -43,17 +43,32 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
historyModule.reset();
|
|
|
_animationController = AnimationController(vsync: this, duration: Duration(seconds: 1));
|
|
|
_animationController.repeat(reverse: true);
|
|
|
-
|
|
|
+ initializePages();
|
|
|
+
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
historyFunction.getActiveForum();
|
|
|
// getUser taruh sini dulu. di-load bareng render widget. 031125
|
|
|
historyFunction.getUser();
|
|
|
+ historyModule.setCurrentPage();
|
|
|
historyFunction.getMission();
|
|
|
});
|
|
|
// TODO: implement initState
|
|
|
super.initState();
|
|
|
}
|
|
|
|
|
|
+ void initializePages(){
|
|
|
+ Map<String, List> data = {};
|
|
|
+ Map<String, bool> isLoad = {};
|
|
|
+
|
|
|
+ for(var i=0; i<pages.length; i++){
|
|
|
+ // debugPrint('initialize for ${pages[i]}, length: ${pages.length}');
|
|
|
+ data[pages[i]] = [];
|
|
|
+ isLoad[pages[i]] = false;
|
|
|
+ }
|
|
|
+ historyModule.initDataPages(data);
|
|
|
+ historyModule.initIsLoadPages(isLoad);
|
|
|
+ }
|
|
|
+
|
|
|
@override
|
|
|
void dispose() {
|
|
|
_animationController.dispose();
|
|
|
@@ -114,21 +129,14 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
],
|
|
|
),
|
|
|
Expanded(
|
|
|
- child: userModuleListen.user().isNotEmpty ? Container(
|
|
|
- alignment: Alignment.topCenter,
|
|
|
- width: U.bodyWidth(context),
|
|
|
- child: LazyLoadScrollView(
|
|
|
- onEndOfPage: () => historyFunction.getMission(),
|
|
|
- scrollOffset: 500,
|
|
|
- child: EasyRefresh(
|
|
|
- header: MaterialHeader(clamping: true, color: primaryColor),
|
|
|
- onRefresh: () => historyFunction.onRefresh(),
|
|
|
- child: historyModuleListen.activeTab().name == 'done' ? doneContainer() : ongoingContainer(),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ) : userModuleListen.resetData() ? Container() : loadingTemplate(() {
|
|
|
- if(mounted) setState(()=>_timeLimit=true);
|
|
|
- },),
|
|
|
+ child: userModuleListen.user().isNotEmpty
|
|
|
+ ? indexedStackedBody()
|
|
|
+ : userModuleListen.resetData()
|
|
|
+ ? Container()
|
|
|
+ : loadingTemplate(() {
|
|
|
+ if(mounted) setState(() => _timeLimit=true);
|
|
|
+ },
|
|
|
+ ),
|
|
|
)
|
|
|
],
|
|
|
),
|
|
|
@@ -151,11 +159,11 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
child: Text('ongoing'.tr(), style: TextStyle(color: activeTab.name == "ongoing" ? textColor : textColor.withValues(alpha: 0.65), fontSize: 16)),
|
|
|
),
|
|
|
onTap: () {
|
|
|
- if (!historyModule.isLoadHistory()) {
|
|
|
+ // if (!historyModule.isLoadHistory()) {
|
|
|
historyModule.setSelectedFilter('none');
|
|
|
historyModule.setActiveTab(HistoryTab.ongoing);
|
|
|
historyFunction.onRefresh();
|
|
|
- }
|
|
|
+ // }
|
|
|
},
|
|
|
),
|
|
|
GestureDetector(
|
|
|
@@ -165,11 +173,11 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
child: Text('done'.tr(), style: TextStyle(color: activeTab.name == "done" ? textColor : textColor.withValues(alpha: 0.65), fontSize: 16)),
|
|
|
),
|
|
|
onTap: () {
|
|
|
- if (!historyModule.isLoadHistory()) {
|
|
|
+ // if (!historyModule.isLoadHistory()) {
|
|
|
historyModule.setSelectedFilter('none');
|
|
|
historyModule.setActiveTab(HistoryTab.done);
|
|
|
historyFunction.onRefresh();
|
|
|
- }
|
|
|
+ // }
|
|
|
},
|
|
|
),
|
|
|
],
|
|
|
@@ -195,7 +203,7 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
child: Text(currentFilters[i]['title'], style: TextStyle(color: historyModuleListen.checkSelectedFilter(currentFilters[i]['value']) ? Colors.white : textColor, fontSize: 16)),
|
|
|
),
|
|
|
onTap: () {
|
|
|
- if (!historyModule.isLoadHistory()) {
|
|
|
+ // if (!historyModule.isLoadHistory()) {
|
|
|
if (historyModule.checkSelectedFilter(currentFilters[i]['value'])) {
|
|
|
historyModule.setSelectedFilter('none');
|
|
|
historyFunction.onRefresh();
|
|
|
@@ -203,55 +211,57 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
historyModule.setSelectedFilter(currentFilters[i]['value']);
|
|
|
historyFunction.onRefresh();
|
|
|
}
|
|
|
- }
|
|
|
+ // }
|
|
|
},
|
|
|
);
|
|
|
}),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
- //# kodingan baru end
|
|
|
|
|
|
- Widget ongoingFilter() {
|
|
|
- final HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
- return SingleChildScrollView(
|
|
|
- scrollDirection: Axis.horizontal,
|
|
|
- child: Row(
|
|
|
- children: List.generate(historyFunction.ongoingList.length, (i) {
|
|
|
- return GestureDetector(
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(left: 16),
|
|
|
- padding: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: historyModuleListen.checkSelectedFilter(historyFunction.ongoingList[i]['value']) ? primaryColor : Color(0xffF2F8F7),
|
|
|
- border: Border.all(color: historyModuleListen.checkSelectedFilter(historyFunction.ongoingList[i]['value']) ? primaryColor : Color(0xffBEC1C1)),
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
- child: Text(historyFunction.ongoingList[i]['title'], style: TextStyle(color: historyModuleListen.checkSelectedFilter(historyFunction.ongoingList[i]['value']) ? Colors.white : textColor, fontSize: 16)),
|
|
|
- ),
|
|
|
- onTap: () {
|
|
|
- if (!historyModule.isLoadHistory()) {
|
|
|
- if (historyModule.checkSelectedFilter(historyFunction.ongoingList[i]['value'])) {
|
|
|
- historyModule.setSelectedFilter('none');
|
|
|
- historyFunction.onRefresh();
|
|
|
- } else {
|
|
|
- historyModule.setSelectedFilter(historyFunction.ongoingList[i]['value']);
|
|
|
- historyFunction.onRefresh();
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- );
|
|
|
- }),
|
|
|
+ Widget indexedStackedBody(){
|
|
|
+ HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
+ int currentIndex = pages.indexOf(historyModuleListen.currentPage());
|
|
|
+// debugPrint('current index: $currentIndex for ${historyModuleListen.currentPage()}');
|
|
|
+
|
|
|
+ return IndexedStack(
|
|
|
+ index: currentIndex,
|
|
|
+ children: List.generate(pages.length, (i){
|
|
|
+ return buildBody(pages[i]);
|
|
|
+ }),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget buildBody(String keyState){
|
|
|
+ HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
+ // debugPrint('build for $keyState. The data is ${historyModuleListen.dataRequests(state: keyState).length}');
|
|
|
+
|
|
|
+ return Container(
|
|
|
+ alignment: Alignment.topCenter,
|
|
|
+ width: U.bodyWidth(context),
|
|
|
+ child: LazyLoadScrollView(
|
|
|
+ onEndOfPage: () => historyFunction.getMission(),
|
|
|
+ scrollOffset: 500,
|
|
|
+ child: EasyRefresh(
|
|
|
+ header: MaterialHeader(clamping: true, color: primaryColor),
|
|
|
+ onRefresh: () => historyFunction.onRefresh(),
|
|
|
+ child: keyState.startsWith('done',0) ? doneContainer(historyModuleListen, keyState) : ongoingContainer(historyModuleListen, keyState),
|
|
|
+ ),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
+ //# kodingan baru end
|
|
|
+
|
|
|
+ Widget ongoingContainer(HistoryModule historyModuleListen, String state) {
|
|
|
+ // final HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
+ final dataPending = historyModuleListen.dataPending();
|
|
|
+ final dataRequest = historyModuleListen.dataRequests(state: state);
|
|
|
|
|
|
- Widget ongoingContainer() {
|
|
|
- final HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
return SingleChildScrollView(
|
|
|
child: Column(
|
|
|
children: [
|
|
|
U.newServerVersion(1709864293) && !U.getInternetStatus() ? Column(
|
|
|
- children: List.generate(historyModuleListen.dataPending().length, (i) {
|
|
|
+ children: List.generate(dataPending.length, (i) {
|
|
|
return GestureDetector(
|
|
|
child: Container(
|
|
|
padding: EdgeInsets.all(16),
|
|
|
@@ -260,17 +270,17 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
children: [
|
|
|
Row(
|
|
|
children: [
|
|
|
- imageTiles(imageUrl: historyModuleListen.dataPending()[i]['image'] ?? "null"),
|
|
|
+ imageTiles(imageUrl: dataPending[i]['image'] ?? "null"),
|
|
|
SizedBox(width: 16),
|
|
|
Expanded(
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- Text(historyModuleListen.dataPending()[i]['title'], style: TextStyle(color: textColor, fontWeight: FontWeight.w500), overflow: TextOverflow.ellipsis),
|
|
|
+ Text(dataPending[i]['title'], style: TextStyle(color: textColor, fontWeight: FontWeight.w500), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 6),
|
|
|
- Text(historyModuleListen.dataPending()[i][U.langColumn(context, 'sub')], style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
+ Text(dataPending[i][U.langColumn(context, 'sub')], style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 6),
|
|
|
- Text(convertDate(historyModuleListen.dataPending()[i]['datetimeRequest'], context.locale.toString()), style: TextStyle(color: textColor, fontSize: 13, fontWeight: FontWeight.w300)),
|
|
|
+ Text(convertDate(dataPending[i]['datetimeRequest'], context.locale.toString()), style: TextStyle(color: textColor, fontSize: 13, fontWeight: FontWeight.w300)),
|
|
|
],
|
|
|
),
|
|
|
)
|
|
|
@@ -311,7 +321,7 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
) : Container(),
|
|
|
|
|
|
Column(
|
|
|
- children: List.generate(historyModuleListen.dataMisi().length, (i) {
|
|
|
+ children: List.generate(dataRequest.length, (i) {
|
|
|
return GestureDetector(
|
|
|
child: Container(
|
|
|
padding: EdgeInsets.all(16),
|
|
|
@@ -320,31 +330,31 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
children: [
|
|
|
Row(
|
|
|
children: [
|
|
|
- imageTiles(imageUrl: historyModuleListen.dataMisi()[i]['_requestImage'] ?? "null"),
|
|
|
+ imageTiles(imageUrl: dataRequest[i]['_requestImage'] ?? "null"),
|
|
|
SizedBox(width: 16),
|
|
|
Expanded(
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- Text(historyModuleListen.dataMisi()[i][U.langColumn(context, 'requestGroupDescription')]??'', style: TextStyle(color: textColor, fontWeight: FontWeight.w500), overflow: TextOverflow.ellipsis),
|
|
|
+ Text(dataRequest[i][U.langColumn(context, 'requestGroupDescription')]??'', style: TextStyle(color: textColor, fontWeight: FontWeight.w500), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 6),
|
|
|
- Text(historyModuleListen.dataMisi()[i][U.langColumn(context, 'requestSubject')]??'', style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
+ Text(dataRequest[i][U.langColumn(context, 'requestSubject')]??'', style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 6),
|
|
|
- renderRequested(historyModuleListen.dataMisi()[i]),
|
|
|
- Text(convertDate(historyModuleListen.dataMisi()[i]['datetimeRequest']??'', context.locale.toString()), style: TextStyle(color: textColor, fontSize: 13, fontWeight: FontWeight.w300)),
|
|
|
+ renderRequested(dataRequest[i]),
|
|
|
+ Text(convertDate(dataRequest[i]['datetimeRequest']??'', context.locale.toString()), style: TextStyle(color: textColor, fontSize: 13, fontWeight: FontWeight.w300)),
|
|
|
],
|
|
|
),
|
|
|
)
|
|
|
],
|
|
|
),
|
|
|
- historyModuleListen.dataMisi()[i]['currentState'] == 'DIMULAI' || historyModuleListen.dataMisi()[i]['_hasForum'] ? Column(
|
|
|
+ dataRequest[i]['currentState'] == 'DIMULAI' || dataRequest[i]['_hasForum'] ? Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
SizedBox(height: 16),
|
|
|
divider(),
|
|
|
],
|
|
|
) : Container(),
|
|
|
- historyModuleListen.dataMisi()[i]['_activeHoldRequest'] != null ? Container(
|
|
|
+ dataRequest[i]['_activeHoldRequest'] != null ? Container(
|
|
|
width: double.infinity,
|
|
|
margin: EdgeInsets.only(top: 16),
|
|
|
child: Row(
|
|
|
@@ -354,10 +364,10 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
decoration: BoxDecoration(image: DecorationImage(image: AssetImage('assets/image/general/Watch.png'), fit: BoxFit.cover)),
|
|
|
),
|
|
|
SizedBox(width: 8),
|
|
|
- Expanded(child: Text(historyModuleListen.dataMisi()[i]['_activeHoldRequest']['description'], style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis))
|
|
|
+ Expanded(child: Text(dataRequest[i]['_activeHoldRequest']['description'], style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis))
|
|
|
],
|
|
|
),
|
|
|
- ) : historyModuleListen.dataMisi()[i]['currentState'] == 'DIMULAI' ? Container(
|
|
|
+ ) : dataRequest[i]['currentState'] == 'DIMULAI' ? Container(
|
|
|
width: double.infinity,
|
|
|
margin: EdgeInsets.only(top: 16),
|
|
|
child: Row(
|
|
|
@@ -370,18 +380,18 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
image: DecorationImage(image: AssetImage('assets/image/general/Avatar.jpg'), fit: BoxFit.cover)),
|
|
|
),
|
|
|
SizedBox(width: 8),
|
|
|
- Expanded(child: Text(historyModuleListen.dataMisi()[i]['servantNameStart'] + 'isWorking'.tr(), style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis))
|
|
|
+ Expanded(child: Text(dataRequest[i]['servantNameStart'] + 'isWorking'.tr(), style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis))
|
|
|
],
|
|
|
),
|
|
|
) : Container(),
|
|
|
- !historyModuleListen.dataMisi()[i]['autoResponse'] && historyModuleListen.dataMisi()[i]['_hasForum'] && historyModuleListen.dataMisi()[i]['_forumMsg'] != null ? Container(
|
|
|
+ !dataRequest[i]['autoResponse'] && dataRequest[i]['_hasForum'] && dataRequest[i]['_forumMsg'] != null ? Container(
|
|
|
width: double.infinity,
|
|
|
margin: EdgeInsets.only(top: 16),
|
|
|
child: Row(
|
|
|
children: [
|
|
|
FadeTransition(opacity: _animationController, child: U.iconsax('messages-3', color: primaryColor)),
|
|
|
SizedBox(width: 8),
|
|
|
- Expanded(child: Text('“${historyModuleListen.dataMisi()[i]['_forumMsg']}”', style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 14, fontStyle: FontStyle.italic), overflow: TextOverflow.ellipsis,))
|
|
|
+ Expanded(child: Text('“${dataRequest[i]['_forumMsg']}”', style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 14, fontStyle: FontStyle.italic), overflow: TextOverflow.ellipsis,))
|
|
|
],
|
|
|
),
|
|
|
)
|
|
|
@@ -398,7 +408,7 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
),
|
|
|
!historyModuleListen.stopLoadHistory() || (historyModuleListen.isLoadHistory() && historyModuleListen.page() > 0)
|
|
|
? Container(margin: EdgeInsets.only(top: historyModuleListen.page() > 0 ? 0 : 50), child: loadingTemplateNoVoid())
|
|
|
- : historyModuleListen.dataMisi().isEmpty && historyModuleListen.dataPending().isEmpty
|
|
|
+ : dataRequest.isEmpty && dataPending.isEmpty
|
|
|
? NoDataPage()
|
|
|
: Container(),
|
|
|
],
|
|
|
@@ -406,45 +416,15 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- Widget doneFilter() {
|
|
|
- final HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
- return Row(
|
|
|
- children: List.generate(historyFunction.doneList.length, (i) {
|
|
|
- return GestureDetector(
|
|
|
- child: Container(
|
|
|
- margin: EdgeInsets.only(left: 16),
|
|
|
- padding: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: historyModuleListen.checkSelectedFilter(historyFunction.doneList[i]['value']) ? primaryColor : Color(0xffF2F8F7),
|
|
|
- border: Border.all(color: historyModuleListen.checkSelectedFilter(historyFunction.doneList[i]['value']) ? primaryColor : Color(0xffBEC1C1)),
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
- child: Text(historyFunction.doneList[i]['title'], style: TextStyle(color: historyModuleListen.checkSelectedFilter(historyFunction.doneList[i]['value']) ? Colors.white : textColor, fontSize: 16)),
|
|
|
- ),
|
|
|
- onTap: () {
|
|
|
- if (!historyModule.isLoadHistory()) {
|
|
|
- if (historyModule.checkSelectedFilter(historyFunction.doneList[i]['value'])) {
|
|
|
- historyModule.setSelectedFilter(0);
|
|
|
- historyFunction.onRefresh();
|
|
|
- } else {
|
|
|
- historyModule.setSelectedFilter(historyFunction.doneList[i]['value']);
|
|
|
- historyFunction.onRefresh();
|
|
|
- }
|
|
|
- } else {
|
|
|
- UIService.showError("Ngko sek to!");
|
|
|
- }
|
|
|
- },
|
|
|
- );
|
|
|
- }),
|
|
|
- );
|
|
|
- }
|
|
|
+ Widget doneContainer(HistoryModule historyModuleListen, String state) {
|
|
|
+ // final HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
+ final dataRequest = historyModuleListen.dataRequests(state: state);
|
|
|
|
|
|
- Widget doneContainer() {
|
|
|
- final HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
return SingleChildScrollView(
|
|
|
child: Column(
|
|
|
children: [
|
|
|
Column(
|
|
|
- children: List.generate(historyModuleListen.dataMisi().length, (i) {
|
|
|
+ children: List.generate(dataRequest.length, (i) {
|
|
|
return GestureDetector(
|
|
|
child: Container(
|
|
|
padding: EdgeInsets.all(16),
|
|
|
@@ -456,28 +436,28 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
Row(
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- imageTiles(imageUrl: historyModuleListen.dataMisi()[i]['_requestImage'] ?? "null"),
|
|
|
+ imageTiles(imageUrl: dataRequest[i]['_requestImage'] ?? "null"),
|
|
|
SizedBox(width: 16),
|
|
|
Expanded(
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- Text(historyModuleListen.dataMisi()[i][U.langColumn(context, 'requestGroupDescription')]??"",
|
|
|
+ Text(dataRequest[i][U.langColumn(context, 'requestGroupDescription')]??"",
|
|
|
style: TextStyle(color: textColor, fontWeight: FontWeight.w500), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 6),
|
|
|
- Text(historyModuleListen.dataMisi()[i][U.langColumn(context, 'requestSubject')]??"", style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
+ Text(dataRequest[i][U.langColumn(context, 'requestSubject')]??"", style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 6),
|
|
|
- renderRequested(historyModuleListen.dataMisi()[i]),
|
|
|
+ renderRequested(dataRequest[i]),
|
|
|
Row(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- Text(convertDate(historyModuleListen.dataMisi()[i]['datetimeRequest'], context.locale.toString()),
|
|
|
+ Text(convertDate(dataRequest[i]['datetimeRequest'], context.locale.toString()),
|
|
|
style: TextStyle(color: textColor, fontSize: 13, fontWeight: FontWeight.w300)),
|
|
|
Text(
|
|
|
- ' - ${historyModuleListen.dataMisi()[i]['currentState'] == 'DISELESAIKAN' || historyModuleListen.dataMisi()[i]['currentState'] == 'TUNTAS' ? 'stateFinish'.tr() : 'stateCancel'.tr()}',
|
|
|
+ ' - ${dataRequest[i]['currentState'] == 'DISELESAIKAN' || dataRequest[i]['currentState'] == 'TUNTAS' ? 'stateFinish'.tr() : 'stateCancel'.tr()}',
|
|
|
style: TextStyle(
|
|
|
- color: historyModuleListen.dataMisi()[i]['currentState'] == 'DISELESAIKAN' ||
|
|
|
- historyModuleListen.dataMisi()[i]['currentState'] == 'TUNTAS'
|
|
|
+ color: dataRequest[i]['currentState'] == 'DISELESAIKAN' ||
|
|
|
+ dataRequest[i]['currentState'] == 'TUNTAS'
|
|
|
? primaryColor
|
|
|
: Color(0xffD81010),
|
|
|
fontSize: 13,
|
|
|
@@ -495,8 +475,8 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
children: [
|
|
|
- !historyModuleListen.dataMisi()[i]['autoResponse'] && historyModuleListen.dataMisi()[i]['servantIdentityStart'] != '#system' && (historyModuleListen.dataMisi()[i]['currentState'] == 'TUNTAS' || historyModuleListen.dataMisi()[i]['currentState'] == 'DISELESAIKAN') ? Container(
|
|
|
- child: historyFunction.askForRate(Provider.of<HistoryModule>(context, listen: true).dataMisi()[i]) ? GestureDetector(
|
|
|
+ !dataRequest[i]['autoResponse'] && dataRequest[i]['servantIdentityStart'] != '#system' && (dataRequest[i]['currentState'] == 'TUNTAS' || dataRequest[i]['currentState'] == 'DISELESAIKAN') ? Container(
|
|
|
+ child: historyFunction.askForRate(dataRequest[i]) ? GestureDetector(
|
|
|
child: Container(
|
|
|
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 16),
|
|
|
decoration: BoxDecoration(
|
|
|
@@ -506,31 +486,31 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
child: Text('rateReq'.tr(), style: TextStyle(color: secondaryColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
),
|
|
|
onTap: () {
|
|
|
- U.newServerVersion(1716279633) ? navigateTo(context, MobHistoryRatingPage(historyModule.dataMisi()[i])).then((tempRating) {
|
|
|
+ U.newServerVersion(1716279633) ? navigateTo(context, MobHistoryRatingPage(historyModule.dataRequests()[i])).then((tempRating) {
|
|
|
if(tempRating != null){
|
|
|
historyModule.setSatisfaction(i, tempRating);
|
|
|
}
|
|
|
- }) : rateMission(context, historyModule.dataMisi()[i], i);
|
|
|
+ }) : rateMission(context, historyModule.dataRequests()[i], i);
|
|
|
},
|
|
|
- ) : !historyFunction.isAutoResponse(historyModuleListen.dataMisi()[i]) ? Row(
|
|
|
+ ) : !historyFunction.isAutoResponse(dataRequest[i]) ? Row(
|
|
|
children: [
|
|
|
- Image(image: AssetImage(rating[historyModuleListen.dataMisi()[i]['satisfactionRate'] - 1]['image'].toString()), width: 25),
|
|
|
+ Image(image: AssetImage(rating[dataRequest[i]['satisfactionRate'] - 1]['image'].toString()), width: 25),
|
|
|
SizedBox(width: 5),
|
|
|
- Text(rating[historyModuleListen.dataMisi()[i]['satisfactionRate'] - 1]['label'].toString(), style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
+ Text(rating[dataRequest[i]['satisfactionRate'] - 1]['label'].toString(), style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
],
|
|
|
) : Container(),
|
|
|
- ) : message(historyModuleListen.dataMisi()[i]['_hasForum'], historyModuleListen.dataMisi()[i]['_forumMsg'] ?? "null"),
|
|
|
+ ) : message(dataRequest[i]['_hasForum'], dataRequest[i]['_forumMsg'] ?? "null"),
|
|
|
GestureDetector(
|
|
|
child: Container(
|
|
|
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 16),
|
|
|
- child: Text('reqAgain'.tr(), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
decoration: BoxDecoration(color: Colors.white, border: Border.all(color: primaryColor), borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
+ child: Text('reqAgain'.tr(), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
),
|
|
|
onTap: () => historyFunction.requestAgainAction(i),
|
|
|
)
|
|
|
],
|
|
|
),
|
|
|
- (!historyModuleListen.dataMisi()[i]['autoResponse'] && historyModuleListen.dataMisi()[i]['servantIdentityStart'] != '#system' && (historyModuleListen.dataMisi()[i]['currentState'] == 'TUNTAS' || historyModuleListen.dataMisi()[i]['currentState'] == 'DISELESAIKAN')) ? message(historyModuleListen.dataMisi()[i]['_hasForum'], historyModuleListen.dataMisi()[i]['_forumMsg'] ?? "null", top: 16) : Container()
|
|
|
+ (!dataRequest[i]['autoResponse'] && dataRequest[i]['servantIdentityStart'] != '#system' && (dataRequest[i]['currentState'] == 'TUNTAS' || dataRequest[i]['currentState'] == 'DISELESAIKAN')) ? message(dataRequest[i]['_hasForum'], dataRequest[i]['_forumMsg'] ?? "null", top: 16) : Container()
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -546,7 +526,7 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
})),
|
|
|
!historyModuleListen.stopLoadHistory() || (historyModuleListen.isLoadHistory() && historyModuleListen.page() > 0)
|
|
|
? Container(margin: EdgeInsets.only(top: historyModuleListen.page() > 0 ? 0 : 50), child: loadingTemplateNoVoid())
|
|
|
- : historyModuleListen.dataMisi().length == 0
|
|
|
+ : dataRequest.isEmpty
|
|
|
? NoDataPage()
|
|
|
: Container(),
|
|
|
],
|
|
|
@@ -686,7 +666,3 @@ class _MobHistoryPageState extends State<MobHistoryPage> with TickerProviderStat
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-Widget mbuh(context){
|
|
|
- return Text('data');
|
|
|
-}
|