|
@@ -6,11 +6,16 @@ import 'package:lazy_load_scrollview/lazy_load_scrollview.dart';
|
|
|
import 'package:provider/provider.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
import 'package:telnow_mobile_new/src/api/api_auth_provider.dart';
|
|
import 'package:telnow_mobile_new/src/api/api_auth_provider.dart';
|
|
|
import 'package:telnow_mobile_new/src/layouts/functions/history.dart';
|
|
import 'package:telnow_mobile_new/src/layouts/functions/history.dart';
|
|
|
|
|
+import 'package:telnow_mobile_new/src/layouts/mobile/history_detail.dart';
|
|
|
|
|
+import 'package:telnow_mobile_new/src/layouts/mobile/history_detail_pending.dart';
|
|
|
import 'package:telnow_mobile_new/src/layouts/components/template.dart';
|
|
import 'package:telnow_mobile_new/src/layouts/components/template.dart';
|
|
|
-import 'package:telnow_mobile_new/src/layouts/web/history_detail.dart';
|
|
|
|
|
|
|
+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/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/provider.dart';
|
|
|
|
|
|
|
|
|
|
+import 'history_detail.dart';
|
|
|
|
|
+
|
|
|
class WebHistoryPage extends StatefulWidget {
|
|
class WebHistoryPage extends StatefulWidget {
|
|
|
const WebHistoryPage({super.key});
|
|
const WebHistoryPage({super.key});
|
|
|
|
|
|
|
@@ -19,10 +24,11 @@ class WebHistoryPage extends StatefulWidget {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStateMixin {
|
|
class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStateMixin {
|
|
|
- final HistoryFunction hisFunc = HistoryFunction();
|
|
|
|
|
|
|
+ final HistoryFunction historyFunction = HistoryFunction();
|
|
|
late AnimationController _animationController;
|
|
late AnimationController _animationController;
|
|
|
- late final HistoryModule historyModule = Provider.of<HistoryModule>(context, listen: false);
|
|
|
|
|
- late final UserModule userModule = Provider.of<UserModule>(context, listen: false);
|
|
|
|
|
|
|
+ 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 = [
|
|
var rating = [
|
|
|
{'key': 1, 'image': "assets/image/icon/very_dissatisfied.png", 'label': 'disatisfied'.tr()},
|
|
{'key': 1, 'image': "assets/image/icon/very_dissatisfied.png", 'label': 'disatisfied'.tr()},
|
|
@@ -35,18 +41,37 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
void initState() {
|
|
void initState() {
|
|
|
- // print(U.newServerVersion(1716279633));
|
|
|
|
|
|
|
+ historyModule = Provider.of<HistoryModule>(context, listen: false);
|
|
|
|
|
+ userModule = Provider.of<UserModule>(context, listen: false);
|
|
|
historyModule.reset();
|
|
historyModule.reset();
|
|
|
_animationController = AnimationController(vsync: this, duration: Duration(seconds: 1));
|
|
_animationController = AnimationController(vsync: this, duration: Duration(seconds: 1));
|
|
|
_animationController.repeat(reverse: true);
|
|
_animationController.repeat(reverse: true);
|
|
|
|
|
+ initializePages();
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
- hisFunc.getActiveForum();
|
|
|
|
|
|
|
+ historyFunction.getActiveForum();
|
|
|
|
|
+ // getUser taruh sini dulu. di-load bareng render widget. 031125
|
|
|
|
|
+ historyFunction.getUser();
|
|
|
|
|
+ historyModule.setCurrentPage();
|
|
|
|
|
+ historyFunction.getMission();
|
|
|
});
|
|
});
|
|
|
// TODO: implement initState
|
|
// TODO: implement initState
|
|
|
super.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
|
|
@override
|
|
|
void dispose() {
|
|
void dispose() {
|
|
|
_animationController.dispose();
|
|
_animationController.dispose();
|
|
@@ -55,14 +80,16 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
- final HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
|
|
- final UserModule userModuleListen = Provider.of<UserModule>(context);
|
|
|
|
|
|
|
+ final historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
|
|
+ final userModuleListen = Provider.of<UserModule>(context);
|
|
|
|
|
+ eventBus.on().listen((event){
|
|
|
|
|
+ debugPrint(event.toString());
|
|
|
|
|
+ });
|
|
|
return userModuleListen.resetData() ? RefreshPage(() {
|
|
return userModuleListen.resetData() ? RefreshPage(() {
|
|
|
userModule.setResetData(false);
|
|
userModule.setResetData(false);
|
|
|
- hisFunc.getActiveForum();
|
|
|
|
|
- }) : Scaffold(
|
|
|
|
|
|
|
+ historyFunction.getActiveForum();
|
|
|
|
|
+ }) : _timeLimit ? showButton(context) : Scaffold(
|
|
|
backgroundColor: backgroundColor,
|
|
backgroundColor: backgroundColor,
|
|
|
- appBar: PreferredSize(preferredSize: Size.fromHeight(0), child: AppBar(elevation: 0, backgroundColor: primaryColor)),
|
|
|
|
|
body: Column(
|
|
body: Column(
|
|
|
children: [
|
|
children: [
|
|
|
Container(
|
|
Container(
|
|
@@ -83,7 +110,7 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
- onTap: () => hisFunc.deleteData(context),
|
|
|
|
|
|
|
+ onTap: () => historyFunction.deleteData(context),
|
|
|
) : GestureDetector(
|
|
) : GestureDetector(
|
|
|
child: Text('buttonBack'.tr(), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
child: Text('buttonBack'.tr(), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
onTap: (){
|
|
onTap: (){
|
|
@@ -101,89 +128,99 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
- Row(
|
|
|
|
|
- children: [
|
|
|
|
|
- GestureDetector(
|
|
|
|
|
- child: Container(
|
|
|
|
|
- padding: EdgeInsets.symmetric(vertical: 5, horizontal: 16),
|
|
|
|
|
- decoration: BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(color: historyModuleListen.activeTab() == 1 ? primaryColor : primaryColor.withValues(alpha: 0.3), width: historyModuleListen.activeTab() == 1 ? 2 : 1))),
|
|
|
|
|
- child: Text('ongoing'.tr(), style: TextStyle(color: historyModuleListen.activeTab() == 1 ? textColor : textColor.withValues(alpha: 0.65), fontSize: 16)),
|
|
|
|
|
- ),
|
|
|
|
|
- onTap: () {
|
|
|
|
|
- if (!historyModule.isLoadHistory()) {
|
|
|
|
|
- historyModule.setSelectedFilter(0);
|
|
|
|
|
- historyModule.setActiveTab(HistoryTab.ongoing);
|
|
|
|
|
- hisFunc.onRefresh();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- ),
|
|
|
|
|
- GestureDetector(
|
|
|
|
|
- child: Container(
|
|
|
|
|
- padding: EdgeInsets.symmetric(vertical: 5, horizontal: 16),
|
|
|
|
|
- decoration: BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(color: historyModuleListen.activeTab() == 0 ? primaryColor : primaryColor.withValues(alpha: 0.3), width: historyModuleListen.activeTab() == 0 ? 2 : 1))),
|
|
|
|
|
- child: Text('done'.tr(), style: TextStyle(color: historyModuleListen.activeTab() == 0 ? textColor : textColor.withValues(alpha: 0.65), fontSize: 16)),
|
|
|
|
|
- ),
|
|
|
|
|
- onTap: () {
|
|
|
|
|
- if (!historyModule.isLoadHistory()) {
|
|
|
|
|
- historyModule.setSelectedFilter(0);
|
|
|
|
|
- historyModule.setActiveTab(HistoryTab.done);
|
|
|
|
|
- hisFunc.onRefresh();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- ),
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ SizedBox(height: 16),
|
|
|
|
|
+ buildTab(historyModuleListen),
|
|
|
|
|
+ SizedBox(height: 20),
|
|
|
|
|
+ buildFilter(historyModuleListen),
|
|
|
|
|
+ // historyModuleListen.activeTab() == 0 ? doneFilter() : ongoingFilter(),
|
|
|
SizedBox(height: 20),
|
|
SizedBox(height: 20),
|
|
|
- historyModuleListen.activeTab() == 0 ? doneFilter() : ongoingFilter(),
|
|
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
Expanded(
|
|
Expanded(
|
|
|
- child: userModuleListen.user().isNotEmpty ? Container(
|
|
|
|
|
- width: double.infinity,
|
|
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 100),
|
|
|
|
|
- child: LazyLoadScrollView(
|
|
|
|
|
- onEndOfPage: () => hisFunc.getMission(),
|
|
|
|
|
- scrollOffset: 500,
|
|
|
|
|
- child: EasyRefresh(
|
|
|
|
|
- header: MaterialHeader(clamping: true, color: primaryColor),
|
|
|
|
|
- onRefresh: ()=>hisFunc.onRefresh(),
|
|
|
|
|
- child: historyModuleListen.activeTab() == 0 ? doneContainer() : ongoingContainer(),
|
|
|
|
|
- ),
|
|
|
|
|
- ),
|
|
|
|
|
- ) : userModuleListen.resetData() ? Container() : _timeLimit ? showButton(context) : loadingTemplate(() {if(mounted) setState(()=>_timeLimit=true);},),
|
|
|
|
|
|
|
+ child: userModuleListen.user().isNotEmpty
|
|
|
|
|
+ ? indexedStackedBody()
|
|
|
|
|
+ : userModuleListen.resetData()
|
|
|
|
|
+ ? Container()
|
|
|
|
|
+ : loadingTemplate(() {
|
|
|
|
|
+ if(mounted) setState(() => _timeLimit=true);
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Widget ongoingFilter() {
|
|
|
|
|
- final HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
|
|
|
|
+ //# kodingan baru start
|
|
|
|
|
+ Widget buildTab(historyModuleListen){
|
|
|
|
|
+ HistoryTab activeTab = historyModuleListen.activeTab();
|
|
|
|
|
+
|
|
|
|
|
+ return Row(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ GestureDetector(
|
|
|
|
|
+ child: Container(
|
|
|
|
|
+ margin: EdgeInsets.only(left: 16),
|
|
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 5, horizontal: 16),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: Colors.white,
|
|
|
|
|
+ border: Border(bottom: BorderSide(color: activeTab.name == "ongoing" ? primaryColor : primaryColor.withValues(alpha: 0.3), width: activeTab.name == "ongoing" ? 2 : 1))),
|
|
|
|
|
+ child: Text('ongoing'.tr(), style: TextStyle(color: activeTab.name == "ongoing" ? textColor : textColor.withValues(alpha: 0.65), fontSize: 16)),
|
|
|
|
|
+ ),
|
|
|
|
|
+ onTap: () {
|
|
|
|
|
+ // if (!historyModule.isLoadHistory()) {
|
|
|
|
|
+ historyModule.setSelectedFilter('none');
|
|
|
|
|
+ historyModule.setActiveTab(HistoryTab.ongoing);
|
|
|
|
|
+ historyFunction.onRefresh();
|
|
|
|
|
+ // }
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
|
|
+ GestureDetector(
|
|
|
|
|
+ child: Container(
|
|
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 5, horizontal: 16),
|
|
|
|
|
+ decoration: BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(color: activeTab.name == "done" ? primaryColor : primaryColor.withValues(alpha: 0.3), width: activeTab.name == "done" ? 2 : 1))),
|
|
|
|
|
+ child: Text('done'.tr(), style: TextStyle(color: activeTab.name == "done" ? textColor : textColor.withValues(alpha: 0.65), fontSize: 16)),
|
|
|
|
|
+ ),
|
|
|
|
|
+ onTap: () {
|
|
|
|
|
+ // if (!historyModule.isLoadHistory()) {
|
|
|
|
|
+ historyModule.setSelectedFilter('none');
|
|
|
|
|
+ historyModule.setActiveTab(HistoryTab.done);
|
|
|
|
|
+ historyFunction.onRefresh();
|
|
|
|
|
+ // }
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Widget buildFilter(historyModuleListen){
|
|
|
|
|
+ HistoryTab tab = historyModuleListen.activeTab();
|
|
|
|
|
+ List currentFilters = tab.filters;
|
|
|
|
|
+
|
|
|
return SingleChildScrollView(
|
|
return SingleChildScrollView(
|
|
|
scrollDirection: Axis.horizontal,
|
|
scrollDirection: Axis.horizontal,
|
|
|
child: Row(
|
|
child: Row(
|
|
|
- children: List.generate(hisFunc.ongoingList.length, (i) {
|
|
|
|
|
|
|
+ children: List.generate(currentFilters.length, (i) {
|
|
|
return GestureDetector(
|
|
return GestureDetector(
|
|
|
child: Container(
|
|
child: Container(
|
|
|
- margin: EdgeInsets.only(right: 16),
|
|
|
|
|
|
|
+ margin: EdgeInsets.only(left: 16),
|
|
|
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
|
- color: historyModuleListen.checkSelectedFilter(hisFunc.ongoingList[i]['value']) ? primaryColor : Color(0xffF2F8F7),
|
|
|
|
|
- border: Border.all(color: historyModuleListen.checkSelectedFilter(hisFunc.ongoingList[i]['value']) ? primaryColor : Color(0xffBEC1C1)),
|
|
|
|
|
|
|
+ color: historyModuleListen.checkSelectedFilter(currentFilters[i]['value']) ? primaryColor : Color(0xffF2F8F7),
|
|
|
|
|
+ border: Border.all(color: historyModuleListen.checkSelectedFilter(currentFilters[i]['value']) ? primaryColor : Color(0xffBEC1C1)),
|
|
|
borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
- child: Text(hisFunc.ongoingList[i]['title'], style: TextStyle(color: historyModuleListen.checkSelectedFilter(hisFunc.ongoingList[i]['value']) ? Colors.white : textColor, fontSize: 16)),
|
|
|
|
|
|
|
+ child: Text(currentFilters[i]['title'], style: TextStyle(color: historyModuleListen.checkSelectedFilter(currentFilters[i]['value']) ? Colors.white : textColor, fontSize: 16)),
|
|
|
),
|
|
),
|
|
|
onTap: () {
|
|
onTap: () {
|
|
|
- if (!historyModule.isLoadHistory()) {
|
|
|
|
|
- if (historyModule.checkSelectedFilter(hisFunc.ongoingList[i]['value'])) {
|
|
|
|
|
- historyModule.setSelectedFilter(0);
|
|
|
|
|
- hisFunc.onRefresh();
|
|
|
|
|
- } else {
|
|
|
|
|
- historyModule.setSelectedFilter(hisFunc.ongoingList[i]['value']);
|
|
|
|
|
- hisFunc.onRefresh();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (!historyModule.isLoadHistory()) {
|
|
|
|
|
+ if (historyModule.checkSelectedFilter(currentFilters[i]['value'])) {
|
|
|
|
|
+ historyModule.setSelectedFilter('none');
|
|
|
|
|
+ historyFunction.onRefresh();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ historyModule.setSelectedFilter(currentFilters[i]['value']);
|
|
|
|
|
+ historyFunction.onRefresh();
|
|
|
}
|
|
}
|
|
|
|
|
+ // }
|
|
|
},
|
|
},
|
|
|
);
|
|
);
|
|
|
}),
|
|
}),
|
|
@@ -191,13 +228,53 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Widget ongoingContainer() {
|
|
|
|
|
- final HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
|
|
|
|
+ Widget indexedStackedBody(){
|
|
|
|
|
+ HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
|
|
+ int currentIndex = pages.indexOf(historyModuleListen.currentPage());
|
|
|
|
|
+// debugPrint('current index: $currentIndex for ${historyModuleListen.currentPage()}');
|
|
|
|
|
+
|
|
|
|
|
+ return buildBody(historyModuleListen.currentPage());
|
|
|
|
|
+ // return IndexedStack(
|
|
|
|
|
+ // index: currentIndex,
|
|
|
|
|
+ // children: List.generate(pages.length, (i){
|
|
|
|
|
+ // return Offstage(
|
|
|
|
|
+ // offstage: currentIndex != i,
|
|
|
|
|
+ // child: 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(
|
|
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 25, horizontal: 100),
|
|
|
|
|
+ alignment: Alignment.topCenter,
|
|
|
|
|
+ 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) {
|
|
|
|
|
+ // debugPrint("KENE MBUH");
|
|
|
|
|
+ final dataPending = historyModuleListen.dataPending();
|
|
|
|
|
+ final dataRequest = historyModuleListen.dataRequests(state: state);
|
|
|
|
|
+ // debugPrint("AFTER LOAD");
|
|
|
return SingleChildScrollView(
|
|
return SingleChildScrollView(
|
|
|
child: Column(
|
|
child: Column(
|
|
|
children: [
|
|
children: [
|
|
|
- U.newServerVersion(1709864293) && !U.getInternetStatus() ? Column(
|
|
|
|
|
- children: List.generate(historyModuleListen.dataPending().length, (i) {
|
|
|
|
|
|
|
+ !U.getInternetStatus() ? Column(
|
|
|
|
|
+ children: List.generate(dataPending.length, (i) {
|
|
|
return GestureDetector(
|
|
return GestureDetector(
|
|
|
child: Container(
|
|
child: Container(
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
@@ -209,7 +286,7 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
Row(
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
children: [
|
|
children: [
|
|
|
- Text(convertDate(historyModuleListen.dataPending()[i]['datetimeRequest'], context.locale.toString()), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
|
|
|
|
+ Text(convertDate(dataPending[i]['datetimeRequest'], context.locale.toString()), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
renderStatus('sending'.tr(), Color(0xff02C539).withValues(alpha: 0.2))
|
|
renderStatus('sending'.tr(), Color(0xff02C539).withValues(alpha: 0.2))
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
@@ -218,22 +295,22 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
SizedBox(height: 10),
|
|
SizedBox(height: 10),
|
|
|
Row(
|
|
Row(
|
|
|
children: [
|
|
children: [
|
|
|
- imageTiles(imageUrl: historyModuleListen.dataPending()[i]['image'] ?? "null"),
|
|
|
|
|
|
|
+ imageTiles(imageUrl: dataPending[i]['image'] ?? "null"),
|
|
|
SizedBox(width: 25),
|
|
SizedBox(width: 25),
|
|
|
Expanded(
|
|
Expanded(
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
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: 10),
|
|
SizedBox(height: 10),
|
|
|
- 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: 5),
|
|
SizedBox(height: 5),
|
|
|
- Text(historyModuleListen.dataPending()[i][U.langColumn(context, 'desc')], style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ Text(dataPending[i][U.langColumn(context, 'desc')], style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
dashed(top: 10, bottom: 10),
|
|
dashed(top: 10, bottom: 10),
|
|
|
Row(
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
children: [
|
|
children: [
|
|
|
- Text('${'location'.tr()}: ${historyModuleListen.dataPending()[i]['location']}', style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ Text('${'location'.tr()}: ${dataPending[i]['location']}', style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
Row(
|
|
Row(
|
|
|
children: [
|
|
children: [
|
|
|
Container(
|
|
Container(
|
|
@@ -262,7 +339,7 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
// });
|
|
// });
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
- hisFunc.onRefresh();
|
|
|
|
|
|
|
+ historyFunction.onRefresh();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
);
|
|
);
|
|
@@ -270,7 +347,7 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
) : Container(),
|
|
) : Container(),
|
|
|
|
|
|
|
|
Column(
|
|
Column(
|
|
|
- children: List.generate(historyModuleListen.dataRequests().length, (i) {
|
|
|
|
|
|
|
+ children: List.generate(dataRequest.length, (i) {
|
|
|
return GestureDetector(
|
|
return GestureDetector(
|
|
|
child: Container(
|
|
child: Container(
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
@@ -281,12 +358,12 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
children: [
|
|
children: [
|
|
|
Row(
|
|
Row(
|
|
|
children: [
|
|
children: [
|
|
|
- Text(convertDate(historyModuleListen.dataRequests()[i]['datetimeRequest'], context.locale.toString()), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
|
|
|
|
+ Text(convertDate(dataRequest[i]['datetimeRequest'], context.locale.toString()), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
SizedBox(width: 15),
|
|
SizedBox(width: 15),
|
|
|
Expanded(
|
|
Expanded(
|
|
|
- child: Text('${'ticketNumber'.tr()}: ${historyModuleListen.dataRequests()[i]['ticketNo']}', style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ child: Text('${'ticketNumber'.tr()}: ${dataRequest[i]['ticketNo']}', style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
),
|
|
),
|
|
|
- historyModuleListen.dataRequests()[i]['currentState'] == 'DIMULAI' ? Row(
|
|
|
|
|
|
|
+ dataRequest[i]['currentState'] == 'DIMULAI' ? Row(
|
|
|
children: [
|
|
children: [
|
|
|
Container(
|
|
Container(
|
|
|
width: 25, height: 25,
|
|
width: 25, height: 25,
|
|
@@ -296,10 +373,10 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
SizedBox(width: 8),
|
|
SizedBox(width: 8),
|
|
|
- Text(historyModuleListen.dataRequests()[i]['servantNameStart'] + 'isWorking'.tr(), style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis)
|
|
|
|
|
|
|
+ Text(dataRequest[i]['servantNameStart'] + 'isWorking'.tr(), style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis)
|
|
|
],
|
|
],
|
|
|
) : Container(),
|
|
) : Container(),
|
|
|
- historyModuleListen.dataRequests()[i]['_activeHoldRequest'] != null?renderStatus('hold'.tr(), Color(0xffD3D3D3)):historyModuleListen.dataRequests()[i]['currentState'] == 'DIMULAI'?renderStatus('onProgress'.tr(), Color(0xffCCA600).withValues(alpha: 0.2)):renderStatus('queued'.tr(), Color(0xff02C539).withValues(alpha: 0.2))
|
|
|
|
|
|
|
+ dataRequest[i]['_activeHoldRequest'] != null?renderStatus('hold'.tr(), Color(0xffD3D3D3)):dataRequest[i]['currentState'] == 'DIMULAI'?renderStatus('onProgress'.tr(), Color(0xffCCA600).withValues(alpha: 0.2)):renderStatus('queued'.tr(), Color(0xff02C539).withValues(alpha: 0.2))
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
SizedBox(height: 10),
|
|
SizedBox(height: 10),
|
|
@@ -307,40 +384,40 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
SizedBox(height: 10),
|
|
SizedBox(height: 10),
|
|
|
Row(
|
|
Row(
|
|
|
children: [
|
|
children: [
|
|
|
- imageTiles(imageUrl: historyModuleListen.dataRequests()[i]['_requestImage'] ?? "null", width: 150, height: 120),
|
|
|
|
|
|
|
+ imageTiles(imageUrl: dataRequest[i]['_requestImage'] ?? "null", width: 150, height: 120),
|
|
|
SizedBox(width: 25),
|
|
SizedBox(width: 25),
|
|
|
Expanded(
|
|
Expanded(
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
- Text(historyModuleListen.dataRequests()[i][U.langColumn(context, 'requestGroupDescription')], style: TextStyle(color: textColor, fontSize: 16), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ Text(dataRequest[i][U.langColumn(context, 'requestGroupDescription')], style: TextStyle(color: textColor, fontSize: 16), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 10),
|
|
SizedBox(height: 10),
|
|
|
- Text(historyModuleListen.dataRequests()[i][U.langColumn(context, 'requestSubject')], style: TextStyle(color: textColor, fontWeight: FontWeight.w600), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ Text(dataRequest[i][U.langColumn(context, 'requestSubject')], style: TextStyle(color: textColor, fontWeight: FontWeight.w600), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 5),
|
|
SizedBox(height: 5),
|
|
|
- Text(historyModuleListen.dataRequests()[i][U.langColumn(context, '_subjectDescription')]??'', style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ Text(dataRequest[i][U.langColumn(context, '_subjectDescription')]??'', style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
dashed(top: 10, bottom: 10),
|
|
dashed(top: 10, bottom: 10),
|
|
|
- renderRequested(historyModuleListen.dataRequests()[i]),
|
|
|
|
|
|
|
+ renderRequested(dataRequest[i]),
|
|
|
Row(
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
crossAxisAlignment: CrossAxisAlignment.center ,
|
|
crossAxisAlignment: CrossAxisAlignment.center ,
|
|
|
children: [
|
|
children: [
|
|
|
- Text('${'location'.tr()}: ${historyModuleListen.dataRequests()[i]['ipphoneExtLocation']}', style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
|
|
- historyModuleListen.dataRequests()[i]['_activeHoldRequest'] != null ? Row(
|
|
|
|
|
|
|
+ Text('${'location'.tr()}: ${dataRequest[i]['ipphoneExtLocation']}', style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
|
|
+ dataRequest[i]['_activeHoldRequest'] != null ? Row(
|
|
|
children: [
|
|
children: [
|
|
|
Container(
|
|
Container(
|
|
|
width: 25, height: 25,
|
|
width: 25, height: 25,
|
|
|
decoration: BoxDecoration(image: DecorationImage(image: AssetImage('assets/image/general/Watch.png'), fit: BoxFit.cover)),
|
|
decoration: BoxDecoration(image: DecorationImage(image: AssetImage('assets/image/general/Watch.png'), fit: BoxFit.cover)),
|
|
|
),
|
|
),
|
|
|
SizedBox(width: 8),
|
|
SizedBox(width: 8),
|
|
|
- Text(historyModuleListen.dataRequests()[i]['_activeHoldRequest']['description'], style: TextStyle(color: textColor, fontSize: 14))
|
|
|
|
|
|
|
+ Text(dataRequest[i]['_activeHoldRequest']['description'], style: TextStyle(color: textColor, fontSize: 14))
|
|
|
],
|
|
],
|
|
|
- ) : historyModuleListen.dataRequests()[i]['_hasForum'] && historyModuleListen.dataRequests()[i]['_forumMsg'] != null ? ConstrainedBox(
|
|
|
|
|
|
|
+ ) : dataRequest[i]['_hasForum'] && dataRequest[i]['_forumMsg'] != null ? ConstrainedBox(
|
|
|
constraints: BoxConstraints(minWidth: 10),
|
|
constraints: BoxConstraints(minWidth: 10),
|
|
|
child: Row(
|
|
child: Row(
|
|
|
children: [
|
|
children: [
|
|
|
FadeTransition(opacity: _animationController, child: U.iconsax('messages-3', color: primaryColor)),
|
|
FadeTransition(opacity: _animationController, child: U.iconsax('messages-3', color: primaryColor)),
|
|
|
SizedBox(width: 8),
|
|
SizedBox(width: 8),
|
|
|
- Text('“${historyModuleListen.dataRequests()[i]['_forumMsg']}”', style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 14, fontStyle: FontStyle.italic))
|
|
|
|
|
|
|
+ Text('“${dataRequest[i]['_forumMsg']}”', style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 14, fontStyle: FontStyle.italic))
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
) : Container(),
|
|
) : Container(),
|
|
@@ -354,7 +431,7 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
- onTap: () => navigateTo(context, WebHistoryDetailPage(index: i)).then((val) {
|
|
|
|
|
|
|
+ onTap: () => navigateTo(context, WebHistoryDetailPage(index: i, locale: context.locale.toString())).then((val) {
|
|
|
val = val??false;
|
|
val = val??false;
|
|
|
if(val) historyModule.cancelMisi(i);
|
|
if(val) historyModule.cancelMisi(i);
|
|
|
}),
|
|
}),
|
|
@@ -363,7 +440,7 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
),
|
|
),
|
|
|
!historyModuleListen.stopLoadHistory() || (historyModuleListen.isLoadHistory() && historyModuleListen.page() > 0)
|
|
!historyModuleListen.stopLoadHistory() || (historyModuleListen.isLoadHistory() && historyModuleListen.page() > 0)
|
|
|
? Container(margin: EdgeInsets.only(top: historyModuleListen.page() > 0 ? 0 : 50), child: loadingTemplateNoVoid())
|
|
? Container(margin: EdgeInsets.only(top: historyModuleListen.page() > 0 ? 0 : 50), child: loadingTemplateNoVoid())
|
|
|
- : historyModuleListen.dataRequests().isEmpty && historyModuleListen.dataPending().isEmpty
|
|
|
|
|
|
|
+ : dataRequest.isEmpty && dataPending.isEmpty
|
|
|
? NoDataPage()
|
|
? NoDataPage()
|
|
|
: Container(),
|
|
: Container(),
|
|
|
],
|
|
],
|
|
@@ -371,43 +448,15 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Widget doneFilter() {
|
|
|
|
|
- final HistoryModule historyModuleListen = Provider.of<HistoryModule>(context);
|
|
|
|
|
- return Row(
|
|
|
|
|
- children: List.generate(hisFunc.doneList.length, (i) {
|
|
|
|
|
- return GestureDetector(
|
|
|
|
|
- child: Container(
|
|
|
|
|
- margin: EdgeInsets.only(right: 16),
|
|
|
|
|
- padding: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- color: historyModuleListen.checkSelectedFilter(hisFunc.doneList[i]['value']) ? primaryColor : Color(0xffF2F8F7),
|
|
|
|
|
- border: Border.all(color: historyModuleListen.checkSelectedFilter(hisFunc.doneList[i]['value']) ? primaryColor : Color(0xffBEC1C1)),
|
|
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
|
|
|
- child: Text(hisFunc.doneList[i]['title'], style: TextStyle(color: historyModuleListen.checkSelectedFilter(hisFunc.doneList[i]['value']) ? Colors.white : textColor, fontSize: 16)),
|
|
|
|
|
- ),
|
|
|
|
|
- onTap: () {
|
|
|
|
|
- if (!historyModule.isLoadHistory()) {
|
|
|
|
|
- if (historyModule.checkSelectedFilter(hisFunc.doneList[i]['value'])) {
|
|
|
|
|
- historyModule.setSelectedFilter(0);
|
|
|
|
|
- hisFunc.onRefresh();
|
|
|
|
|
- } else {
|
|
|
|
|
- historyModule.setSelectedFilter(hisFunc.doneList[i]['value']);
|
|
|
|
|
- hisFunc.onRefresh();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- );
|
|
|
|
|
- }),
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 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(
|
|
return SingleChildScrollView(
|
|
|
child: Column(
|
|
child: Column(
|
|
|
children: [
|
|
children: [
|
|
|
Column(
|
|
Column(
|
|
|
- children: List.generate(historyModuleListen.dataRequests().length, (i) {
|
|
|
|
|
|
|
+ children: List.generate(dataRequest.length, (i) {
|
|
|
return GestureDetector(
|
|
return GestureDetector(
|
|
|
child: Container(
|
|
child: Container(
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
@@ -418,12 +467,12 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
children: [
|
|
children: [
|
|
|
Row(
|
|
Row(
|
|
|
children: [
|
|
children: [
|
|
|
- Text(convertDate(historyModuleListen.dataRequests()[i]['datetimeRequest'], context.locale.toString()), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
|
|
|
|
+ Text(convertDate(dataRequest[i]['datetimeRequest'], context.locale.toString()), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
SizedBox(width: 15),
|
|
SizedBox(width: 15),
|
|
|
Expanded(
|
|
Expanded(
|
|
|
- child: Text('${'ticketNumber'.tr()}: ${historyModuleListen.dataRequests()[i]['ticketNo']}', style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ child: Text('${'ticketNumber'.tr()}: ${dataRequest[i]['ticketNo']}', style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
),
|
|
),
|
|
|
- historyModuleListen.dataRequests()[i]['currentState'] == 'DISELESAIKAN' || historyModuleListen.dataRequests()[i]['currentState'] == 'TUNTAS' ? renderStatus('stateFinish'.tr(), primaryColor.withValues(alpha: 0.4)) : renderStatus('stateCancel'.tr(), Color(0xffD81010).withValues(alpha: 0.4))
|
|
|
|
|
|
|
+ dataRequest[i]['currentState'] == 'DISELESAIKAN' || dataRequest[i]['currentState'] == 'TUNTAS' ? renderStatus('stateFinish'.tr(), primaryColor.withValues(alpha: 0.4)) : renderStatus('stateCancel'.tr(), Color(0xffD81010).withValues(alpha: 0.4))
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
SizedBox(height: 10),
|
|
SizedBox(height: 10),
|
|
@@ -431,20 +480,20 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
SizedBox(height: 10),
|
|
SizedBox(height: 10),
|
|
|
Row(
|
|
Row(
|
|
|
children: [
|
|
children: [
|
|
|
- imageTiles(imageUrl: historyModuleListen.dataRequests()[i]['_requestImage'] ?? "null", width: 150, height: 120),
|
|
|
|
|
|
|
+ imageTiles(imageUrl: dataRequest[i]['_requestImage'] ?? "null", width: 150, height: 120),
|
|
|
SizedBox(width: 25),
|
|
SizedBox(width: 25),
|
|
|
Expanded(
|
|
Expanded(
|
|
|
child: Column(
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
- Text(historyModuleListen.dataRequests()[i][U.langColumn(context, 'requestGroupDescription')], style: TextStyle(color: textColor, fontSize: 16), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ Text(dataRequest[i][U.langColumn(context, 'requestGroupDescription')], style: TextStyle(color: textColor, fontSize: 16), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 10),
|
|
SizedBox(height: 10),
|
|
|
- Text(historyModuleListen.dataRequests()[i][U.langColumn(context, 'requestSubject')], style: TextStyle(color: textColor, fontWeight: FontWeight.w600), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ Text(dataRequest[i][U.langColumn(context, 'requestSubject')], style: TextStyle(color: textColor, fontWeight: FontWeight.w600), overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(height: 5),
|
|
SizedBox(height: 5),
|
|
|
- Text(historyModuleListen.dataRequests()[i][U.langColumn(context, '_subjectDescription')]??'', style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ Text(dataRequest[i][U.langColumn(context, '_subjectDescription')]??'', style: TextStyle(color: textColor), overflow: TextOverflow.ellipsis),
|
|
|
dashed(top: 10, bottom: 10),
|
|
dashed(top: 10, bottom: 10),
|
|
|
- renderRequested(historyModuleListen.dataRequests()[i]),
|
|
|
|
|
- Text('${'location'.tr()}: ${historyModuleListen.dataRequests()[i]['ipphoneExtLocation']}', style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ renderRequested(dataRequest[i]),
|
|
|
|
|
+ Text('${'location'.tr()}: ${dataRequest[i]['ipphoneExtLocation']}', style: TextStyle(color: textColor, fontSize: 14), overflow: TextOverflow.ellipsis),
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
)
|
|
)
|
|
@@ -456,8 +505,8 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
Row(
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
children: [
|
|
children: [
|
|
|
- !historyModuleListen.dataRequests()[i]['autoResponse'] && historyModuleListen.dataRequests()[i]['servantIdentityStart'] != '#system' && (historyModuleListen.dataRequests()[i]['currentState'] == 'TUNTAS' || historyModuleListen.dataRequests()[i]['currentState'] == 'DISELESAIKAN') ? Container(
|
|
|
|
|
- child: hisFunc.askForRate(Provider.of<HistoryModule>(context, listen: true).dataRequests()[i]) ? GestureDetector(
|
|
|
|
|
|
|
+ !dataRequest[i]['autoResponse'] && dataRequest[i]['servantIdentityStart'] != '#system' && (dataRequest[i]['currentState'] == 'TUNTAS' || dataRequest[i]['currentState'] == 'DISELESAIKAN') ? Container(
|
|
|
|
|
+ child: historyFunction.askForRate(Provider.of<HistoryModule>(context, listen: true).dataRequests()[i]) ? GestureDetector(
|
|
|
child: Container(
|
|
child: Container(
|
|
|
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 16),
|
|
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 16),
|
|
|
decoration: BoxDecoration(color: Colors.white, border: Border.all(color: secondaryColor), borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
decoration: BoxDecoration(color: Colors.white, border: Border.all(color: secondaryColor), borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
@@ -466,21 +515,21 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
onTap: () {
|
|
onTap: () {
|
|
|
U.newServerVersion(1716279633) ? rateMissionNew(context, historyModule.dataRequests()[i], i) : rateMission(context, historyModule.dataRequests()[i], i);
|
|
U.newServerVersion(1716279633) ? rateMissionNew(context, historyModule.dataRequests()[i], i) : rateMission(context, historyModule.dataRequests()[i], i);
|
|
|
},
|
|
},
|
|
|
- ) : !hisFunc.isAutoResponse(historyModuleListen.dataRequests()[i]) ? Row(
|
|
|
|
|
|
|
+ ) : !historyFunction.isAutoResponse(dataRequest[i]) ? Row(
|
|
|
children: [
|
|
children: [
|
|
|
- Image(image: AssetImage(rating[historyModuleListen.dataRequests()[i]['satisfactionRate'] - 1]['image'].toString()), width: 25),
|
|
|
|
|
|
|
+ Image(image: AssetImage(rating[dataRequest[i]['satisfactionRate'] - 1]['image'].toString()), width: 25),
|
|
|
SizedBox(width: 5),
|
|
SizedBox(width: 5),
|
|
|
- Text(rating[historyModuleListen.dataRequests()[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(),
|
|
) : Container(),
|
|
|
- ) : message(historyModuleListen.dataRequests()[i]['_hasForum'], historyModuleListen.dataRequests()[i]['_forumMsg'] ?? "null"),
|
|
|
|
|
|
|
+ ) : message(dataRequest[i]['_hasForum'], dataRequest[i]['_forumMsg'] ?? "null"),
|
|
|
GestureDetector(
|
|
GestureDetector(
|
|
|
child: Container(
|
|
child: Container(
|
|
|
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 16),
|
|
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 16),
|
|
|
decoration: BoxDecoration(color: Colors.white, border: Border.all(color: primaryColor), borderRadius: BorderRadius.all(Radius.circular(50))),
|
|
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)),
|
|
child: Text('reqAgain'.tr(), style: TextStyle(color: primaryColor, fontSize: 14)),
|
|
|
),
|
|
),
|
|
|
- onTap: () => hisFunc.requestAgainAction(i),
|
|
|
|
|
|
|
+ onTap: () => historyFunction.requestAgainAction(i),
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
@@ -489,18 +538,18 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
),
|
|
),
|
|
|
onTap: () {
|
|
onTap: () {
|
|
|
if (historyModule.multiSelectMode()) {
|
|
if (historyModule.multiSelectMode()) {
|
|
|
- hisFunc.selectedController(context, i);
|
|
|
|
|
|
|
+ historyFunction.selectedController(context, i);
|
|
|
} else {
|
|
} else {
|
|
|
- navigateTo(context, WebHistoryDetailPage(index: i));
|
|
|
|
|
|
|
+ navigateTo(context, WebHistoryDetailPage(index: i, locale: context.locale.toString(),));
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- onLongPress: () => hisFunc.selectedController(context, i),
|
|
|
|
|
|
|
+ onLongPress: () => historyFunction.selectedController(context, i),
|
|
|
);
|
|
);
|
|
|
})
|
|
})
|
|
|
),
|
|
),
|
|
|
!historyModuleListen.stopLoadHistory() || (historyModuleListen.isLoadHistory() && historyModuleListen.page() > 0)
|
|
!historyModuleListen.stopLoadHistory() || (historyModuleListen.isLoadHistory() && historyModuleListen.page() > 0)
|
|
|
? Container(margin: EdgeInsets.only(top: historyModuleListen.page() > 0 ? 0 : 50), child: loadingTemplateNoVoid())
|
|
? Container(margin: EdgeInsets.only(top: historyModuleListen.page() > 0 ? 0 : 50), child: loadingTemplateNoVoid())
|
|
|
- : historyModuleListen.dataRequests().isEmpty ? NoDataPage() : Container(),
|
|
|
|
|
|
|
+ : dataRequest.isEmpty ? NoDataPage() : Container(),
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
@@ -513,8 +562,8 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
return Column(
|
|
return Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
- Text('${'requestedFor'.tr()}: ${list['informantName']??'-'}' ,style: TextStyle(color: textColor, fontSize: 13), overflow: TextOverflow.ellipsis),
|
|
|
|
|
- SizedBox(height: 5),
|
|
|
|
|
|
|
+ Text('${'requestedFor'.tr()}: ${list['informantName']??'-'}' ,style: TextStyle(color: textColor, fontSize: 13, fontWeight: FontWeight.w300)),
|
|
|
|
|
+ SizedBox(height: 6),
|
|
|
],
|
|
],
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -523,8 +572,8 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
return Column(
|
|
return Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
- Text('${'requestedBy'.tr()}: ${list['receptionistName']??''}' ,style: TextStyle(color: textColor, fontSize: 13), overflow: TextOverflow.ellipsis),
|
|
|
|
|
- SizedBox(height: 5),
|
|
|
|
|
|
|
+ Text('${'requestedBy'.tr()}: ${list['receptionistName']??''}' ,style: TextStyle(color: textColor, fontSize: 13, fontWeight: FontWeight.w300)),
|
|
|
|
|
+ SizedBox(height: 6),
|
|
|
],
|
|
],
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -533,14 +582,16 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
return Container();
|
|
return Container();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Widget message(bool hasForum, String forumMsg, {double top = 0}) {
|
|
|
|
|
- return hasForum ? Container(
|
|
|
|
|
|
|
+ Widget message(bool _hasForum, String _forumMsg, {double top = 0}) {
|
|
|
|
|
+ return _hasForum ? Container(
|
|
|
margin: EdgeInsets.only(top: top),
|
|
margin: EdgeInsets.only(top: top),
|
|
|
child: Row(
|
|
child: Row(
|
|
|
children: [
|
|
children: [
|
|
|
FadeTransition(opacity: _animationController, child: U.iconsax('messages-3', color: primaryColor)),
|
|
FadeTransition(opacity: _animationController, child: U.iconsax('messages-3', color: primaryColor)),
|
|
|
SizedBox(width: 8),
|
|
SizedBox(width: 8),
|
|
|
- Text('“$forumMsg”', style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 14, fontStyle: FontStyle.italic), overflow: TextOverflow.ellipsis),
|
|
|
|
|
|
|
+ Text('“$_forumMsg”',
|
|
|
|
|
+ style: TextStyle(color: textColor.withValues(alpha: 0.75), fontSize: 14, fontStyle: FontStyle.italic),
|
|
|
|
|
+ overflow: TextOverflow.ellipsis),
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
) : Container();
|
|
) : Container();
|
|
@@ -551,111 +602,100 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
|
|
|
padding: EdgeInsets.symmetric(vertical: 3, horizontal: 10),
|
|
padding: EdgeInsets.symmetric(vertical: 3, horizontal: 10),
|
|
|
margin: EdgeInsets.only(left: 10),
|
|
margin: EdgeInsets.only(left: 10),
|
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
|
- color: color, borderRadius: BorderRadius.all(Radius.circular(3))
|
|
|
|
|
|
|
+ color: color, borderRadius: BorderRadius.all(Radius.circular(3))
|
|
|
),
|
|
),
|
|
|
child: Text(text, style: TextStyle(fontSize: 12, color: textColor)),
|
|
child: Text(text, style: TextStyle(fontSize: 12, color: textColor)),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
rateMission(BuildContext context, list, index) {
|
|
rateMission(BuildContext context, list, index) {
|
|
|
- showDialog(
|
|
|
|
|
- context: context,
|
|
|
|
|
|
|
+ showModalBottomSheet(
|
|
|
|
|
+ context: context,
|
|
|
|
|
+ backgroundColor: Colors.transparent,
|
|
|
|
|
+ isScrollControlled: true,
|
|
|
builder: (contexts) {
|
|
builder: (contexts) {
|
|
|
int tempRating = 0;
|
|
int tempRating = 0;
|
|
|
String description = '';
|
|
String description = '';
|
|
|
- return AlertDialog(
|
|
|
|
|
- backgroundColor: Colors.transparent,
|
|
|
|
|
- contentPadding: EdgeInsets.all(0),
|
|
|
|
|
- content: StatefulBuilder(
|
|
|
|
|
- builder: (contextt, setStates) {
|
|
|
|
|
- return Container(
|
|
|
|
|
- decoration: BoxDecoration(color: secondaryColor, borderRadius: BorderRadius.all(Radius.circular(25))),
|
|
|
|
|
- child: Column(
|
|
|
|
|
- mainAxisSize: MainAxisSize.min,
|
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
- children: [
|
|
|
|
|
- Padding(
|
|
|
|
|
- padding: EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
|
|
|
|
- child: Column(
|
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
- children: [
|
|
|
|
|
- Text(list[U.langColumn(context, 'requestSubject')], style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w600)),
|
|
|
|
|
- SizedBox(height: 4),
|
|
|
|
|
- Row(
|
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
- children: [
|
|
|
|
|
- Text('ticketNumber'.tr()+': '+list['ticketNo'], style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w300)),
|
|
|
|
|
- Text(convertDate(list['datetimeRequest'], context.locale.toString()), style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w300)),
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ return StatefulBuilder(
|
|
|
|
|
+ builder: (contextt, setStates) {
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ decoration: BoxDecoration(color: secondaryColor, borderRadius: BorderRadius.only(topLeft: Radius.circular(24), topRight: Radius.circular(24))),
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Padding(
|
|
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Text(list[U.langColumn(context, 'requestSubject')], style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w600)),
|
|
|
|
|
+ SizedBox(height: 4),
|
|
|
|
|
+ Text(convertDate(list['datetimeRequest'], context.locale.toString()), style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w300)),
|
|
|
|
|
+ ],
|
|
|
),
|
|
),
|
|
|
- Container(
|
|
|
|
|
- padding: EdgeInsets.fromLTRB(30, 15, 30, 15),
|
|
|
|
|
- decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(25))),
|
|
|
|
|
- child: Column(
|
|
|
|
|
- children: [
|
|
|
|
|
- Text('satisfactionAsk'.tr(), style: TextStyle(fontSize: 16)),
|
|
|
|
|
- SizedBox(height: 12),
|
|
|
|
|
- Row(
|
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
- children: List.generate(rating.length, (i) {
|
|
|
|
|
- return Expanded(
|
|
|
|
|
- child: GestureDetector(
|
|
|
|
|
- child: Image(
|
|
|
|
|
- image: AssetImage(rating[i]['image'].toString()),
|
|
|
|
|
- color: Colors.white.withValues(alpha: tempRating == rating[i]['key'] ? 1 : 0.3),
|
|
|
|
|
- colorBlendMode: BlendMode.modulate,
|
|
|
|
|
- ),
|
|
|
|
|
- // child: Icon(rating[i]['icon'] as IconData, color: tempRating == rating[i]['key']?rating[i]['color'] as Color:Colors.grey),
|
|
|
|
|
- onTap: () {
|
|
|
|
|
- setStates(() {
|
|
|
|
|
- tempRating = rating[i]['key'] as int;
|
|
|
|
|
- description = rating[i]['label'] as String;
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ ),
|
|
|
|
|
+ Container(
|
|
|
|
|
+ padding: EdgeInsets.fromLTRB(30, 0, 30, 16),
|
|
|
|
|
+ decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(24), topRight: Radius.circular(24))),
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Container(
|
|
|
|
|
+ margin: EdgeInsets.all(10),
|
|
|
|
|
+ width: 40,
|
|
|
|
|
+ height: 4,
|
|
|
|
|
+ decoration: BoxDecoration(color: Color(0xff292D32).withValues(alpha: 0.2), borderRadius: BorderRadius.all(Radius.circular(10))),
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(height: 12),
|
|
|
|
|
+ Text('satisfactionAsk'.tr(), style: TextStyle(fontSize: 16)),
|
|
|
|
|
+ SizedBox(height: 12),
|
|
|
|
|
+ Row(
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
+ children: List.generate(rating.length, (i) {
|
|
|
|
|
+ return Expanded(
|
|
|
|
|
+ child: GestureDetector(
|
|
|
|
|
+ child: Image(
|
|
|
|
|
+ image: AssetImage(rating[i]['image'].toString()),
|
|
|
|
|
+ color: Colors.white.withValues(alpha: tempRating == rating[i]['key'] ? 1 : 0.3),
|
|
|
|
|
+ colorBlendMode: BlendMode.modulate,
|
|
|
),
|
|
),
|
|
|
- );
|
|
|
|
|
- }),
|
|
|
|
|
- ),
|
|
|
|
|
- SizedBox(height: 6),
|
|
|
|
|
- Text(description, style: TextStyle(color: textColor, fontSize: 14, fontWeight: FontWeight.w300), textAlign: TextAlign.center),
|
|
|
|
|
- SizedBox(height: 20),
|
|
|
|
|
- Opacity(
|
|
|
|
|
- opacity: tempRating > 0 ? 1 : 0,
|
|
|
|
|
- child: Row(
|
|
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
- children: [
|
|
|
|
|
- Expanded(child: buttonTemplate(text: 'textCancel'.tr(), backgroundColor: Colors.black12, borderColor: Colors.black12, textColor: textColor, height: 40, action: (){
|
|
|
|
|
- navigateBack(contexts);
|
|
|
|
|
- })),
|
|
|
|
|
- SizedBox(width: 20),
|
|
|
|
|
- Expanded(child: buttonTemplate(text: 'save_rating'.tr(), backgroundColor: primaryColor, borderColor: primaryColor, height: 40, action: ()async{
|
|
|
|
|
- if (tempRating > 0) {
|
|
|
|
|
- var data = {"ticketNo": list['ticketNo'], "rateSatisfy": tempRating};
|
|
|
|
|
|
|
+ // child: Icon(rating[i]['icon'] as IconData, color: tempRating == rating[i]['key']?rating[i]['color'] as Color:Colors.grey),
|
|
|
|
|
+ onTap: () {
|
|
|
|
|
+ setStates(() {
|
|
|
|
|
+ tempRating = rating[i]['key'] as int;
|
|
|
|
|
+ description = rating[i]['label'] as String;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }),
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(height: 6),
|
|
|
|
|
+ Text(description, style: TextStyle(color: textColor, fontSize: 14, fontWeight: FontWeight.w300), textAlign: TextAlign.center),
|
|
|
|
|
+ SizedBox(height: 10),
|
|
|
|
|
+ Opacity(
|
|
|
|
|
+ opacity: tempRating > 0 ? 1 : 0,
|
|
|
|
|
+ child: buttonTemplate(text: 'save_rating'.tr(), backgroundColor: secondaryColor, borderColor: secondaryColor, height: 40, action: ()async{
|
|
|
|
|
+ if (tempRating > 0) {
|
|
|
|
|
+ var data = {"ticketNo": list['ticketNo'], "rateSatisfy": tempRating};
|
|
|
|
|
|
|
|
- var res = await ApiAuthProvider() .postData('/api/requestHistories/rateSatisfy', null, data);
|
|
|
|
|
- if (res != null) {
|
|
|
|
|
- historyModule.setSatisfaction(index, tempRating);
|
|
|
|
|
- navigateBack(contexts);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }))
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
- )
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
- )
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
- );
|
|
|
|
|
- },
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ var res = await ApiAuthProvider() .postData('/api/requestHistories/rateSatisfy', null, data);
|
|
|
|
|
+ if (res != null) {
|
|
|
|
|
+ historyModule.setSatisfaction(index, tempRating);
|
|
|
|
|
+ navigateBack(contexts);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }),
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ )
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
);
|
|
);
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
rateMissionNew(BuildContext context, list, index) {
|
|
rateMissionNew(BuildContext context, list, index) {
|