|
|
|
@ -23,55 +23,59 @@ class TranslationHistoryView |
|
|
|
backgroundColor: |
|
|
|
isDarkMode ? AppColors.darkBackground : Color(0xFFF5F5F8), |
|
|
|
appBar: _buildAppBar(isDarkMode), |
|
|
|
body: Obx(() { |
|
|
|
if (!controller.hasHistory) { |
|
|
|
return Center( |
|
|
|
child: Text( |
|
|
|
'noTranslationHistory'.tr, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey, |
|
|
|
body: SafeArea( |
|
|
|
top: false, |
|
|
|
child: Obx(() { |
|
|
|
if (!controller.hasHistory) { |
|
|
|
return Center( |
|
|
|
child: Text( |
|
|
|
'noTranslationHistory'.tr, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
if (controller.isLoading.value) { |
|
|
|
return Center( |
|
|
|
child: CircularProgressIndicator( |
|
|
|
color: isDarkMode ? AppColors.primary : Colors.blue, |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
if (controller.isLoading.value) { |
|
|
|
return Center( |
|
|
|
child: CircularProgressIndicator( |
|
|
|
color: isDarkMode ? AppColors.primary : Colors.blue, |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
return ListView.builder( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h), |
|
|
|
itemCount: controller.sortedDates.length, |
|
|
|
itemBuilder: (context, index) { |
|
|
|
final date = controller.sortedDates[index]; |
|
|
|
final items = controller.groupedHistory.value[date]!; |
|
|
|
return ListView.builder( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h), |
|
|
|
itemCount: controller.sortedDates.length, |
|
|
|
itemBuilder: (context, index) { |
|
|
|
final date = controller.sortedDates[index]; |
|
|
|
final items = controller.groupedHistory.value[date]!; |
|
|
|
|
|
|
|
return Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Padding( |
|
|
|
padding: EdgeInsets.only(top: 24.h, bottom: 12.h, left: 12.w), |
|
|
|
child: Text( |
|
|
|
date, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[600], |
|
|
|
letterSpacing: 1.0, |
|
|
|
return Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Padding( |
|
|
|
padding: |
|
|
|
EdgeInsets.only(top: 24.h, bottom: 12.h, left: 12.w), |
|
|
|
child: Text( |
|
|
|
date, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[600], |
|
|
|
letterSpacing: 1.0, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
_buildDateGroupContainer(items, isDarkMode), |
|
|
|
], |
|
|
|
); |
|
|
|
}, |
|
|
|
); |
|
|
|
}), |
|
|
|
_buildDateGroupContainer(items, isDarkMode), |
|
|
|
], |
|
|
|
); |
|
|
|
}, |
|
|
|
); |
|
|
|
}), |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|