|
|
@ -10,6 +10,7 @@ import '../controllers/meeting_home_controller.dart'; |
|
|
import '../model/meeting_model.dart'; |
|
|
import '../model/meeting_model.dart'; |
|
|
import '../utils/meeting_ui_utils.dart'; |
|
|
import '../utils/meeting_ui_utils.dart'; |
|
|
import 'bottomSheet/edit_title_bottom_sheet.dart'; |
|
|
import 'bottomSheet/edit_title_bottom_sheet.dart'; |
|
|
|
|
|
import '../../../../data/models/user_Info.dart'; |
|
|
|
|
|
|
|
|
///会议主页面,提供会议列表、会议详情、会议设置 |
|
|
///会议主页面,提供会议列表、会议详情、会议设置 |
|
|
class MeetingHomeView extends StatefulWidget { |
|
|
class MeetingHomeView extends StatefulWidget { |
|
|
@ -173,6 +174,60 @@ class _MeetingHomeViewState extends State<MeetingHomeView> |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
centerTitle: true, |
|
|
centerTitle: true, |
|
|
|
|
|
bottom: PreferredSize( |
|
|
|
|
|
preferredSize: Size.fromHeight(28.w), |
|
|
|
|
|
child: Obx(() { |
|
|
|
|
|
final _ = User.refreshTick.value; |
|
|
|
|
|
final remain = User.isLoggedIn() ? User.instance.meetintegral : 0; |
|
|
|
|
|
final total = User.isLoggedIn() ? User.instance.meettotalintegral : 0; |
|
|
|
|
|
final double fraction = |
|
|
|
|
|
total > 0 ? (remain / total).clamp(0.0, 1.0).toDouble() : 0.0; |
|
|
|
|
|
return Column( |
|
|
|
|
|
mainAxisSize: MainAxisSize.min, |
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch, |
|
|
|
|
|
children: [ |
|
|
|
|
|
Container( |
|
|
|
|
|
padding: EdgeInsets.only(right: 12.w, bottom: 4.w), |
|
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
|
child: Text( |
|
|
|
|
|
_formatHms(remain), |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
LayoutBuilder( |
|
|
|
|
|
builder: (context, constraints) { |
|
|
|
|
|
final barWidth = constraints.maxWidth * fraction; |
|
|
|
|
|
return Stack( |
|
|
|
|
|
children: [ |
|
|
|
|
|
Container( |
|
|
|
|
|
height: 2.w, |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
color: isDarkMode ? Colors.white10 : Colors.black12, |
|
|
|
|
|
borderRadius: BorderRadius.circular(2.w), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
Align( |
|
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
|
child: Container( |
|
|
|
|
|
width: barWidth, |
|
|
|
|
|
height: 2.w, |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
color: MeetingUIUtils.getButtonColor(isDarkMode), |
|
|
|
|
|
borderRadius: BorderRadius.circular(2.w), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
); |
|
|
|
|
|
}, |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
); |
|
|
|
|
|
}), |
|
|
|
|
|
), |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -320,8 +375,8 @@ class _MeetingHomeViewState extends State<MeetingHomeView> |
|
|
: const SizedBox(); |
|
|
: const SizedBox(); |
|
|
}), |
|
|
}), |
|
|
Obx(() { |
|
|
Obx(() { |
|
|
Map taskData = _controller.taskAggregator.taskFinishList |
|
|
Map taskData = |
|
|
.firstWhere( |
|
|
_controller.taskAggregator.taskFinishList.firstWhere( |
|
|
(element) => element['id'] == data.id, |
|
|
(element) => element['id'] == data.id, |
|
|
orElse: () => {}, |
|
|
orElse: () => {}, |
|
|
); |
|
|
); |
|
|
@ -456,4 +511,12 @@ class _MeetingHomeViewState extends State<MeetingHomeView> |
|
|
return '${hours}h ${remainingMinutes}m ${remainingSeconds}s'; |
|
|
return '${hours}h ${remainingMinutes}m ${remainingSeconds}s'; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String _formatHms(int seconds) { |
|
|
|
|
|
int h = seconds ~/ 3600; |
|
|
|
|
|
int m = (seconds % 3600) ~/ 60; |
|
|
|
|
|
int s = seconds % 60; |
|
|
|
|
|
String twoDigits(int n) => n.toString().padLeft(2, '0'); |
|
|
|
|
|
return '${twoDigits(h)}:${twoDigits(m)}:${twoDigits(s)}'; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|