| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- import 'package:trackoffical_app/view/ingame/game_std/utils.dart';
- import '../../../model/game_person_data.dart';
- import 'button_punch.dart';
- import '../game_compass/game_compass_button.dart';
- import '../game_compass/game_compass_top4_data.dart';
- import 'game_std_controller.dart';
- import 'info_view.dart';
- export 'game_std_controller.dart';
- abstract class GameStdViewCompass extends LayerView<GameStdController> {
- const GameStdViewCompass({super.key});
- GamePersonData get model => viewModel.instance.model;
- List<GameCompassTop4Data> top4Data() {
- return [
- GameCompassTop4Data(
- title: '目标',
- child: Obx(() => model.nextPlanPoint.display(
- textStyle: const TextStyle(
- fontSize: 21.78, fontWeight: FontWeight.w500))) ),
- GameCompassTop4Data(
- title: '里程',
- child: Padding(
- padding: const EdgeInsets.only(left: 16, right: 16),
- child: Obx(()=>model.widgetDistance(
- withTrip: !viewModel.isSimpleDashboard.value))) ),
- GameCompassTop4Data(
- title: '点距',
- child: Obx(()=>_nextCPDistance())),
- GameCompassTop4Data(
- title: '配速',
- child: Padding(
- padding: const EdgeInsets.only(left: 16, right: 16),
- child: Obx(()=>model.widgetPace(
- withTrip: !viewModel.isSimpleDashboard.value)))),
- ];
- }
- Widget _nextCPDistance() {
- var unit = ' km';
- var value = '--';
- final dis = model.nextPlanCPDistanceKmShow;
- if(dis!= null){
- (value, unit) = dis.toStringValueAndUnit();
- }
- return RichText(
- text: TextSpan(
- text: value,
- style:
- const TextStyle(fontSize: 28.31, fontWeight: FontWeight.w500),
- children: [
- TextSpan(
- text: unit,
- style:
- const TextStyle(fontSize: 13.07, fontWeight: FontWeight.w500))
- ]));
- }
- List<Widget> topButtons(){
- return [
- buttonInfo(onPressed: () => Get.to(() => InfoView())),
- buttonCheckedCP(onPressed: viewModel.showCheckedCP),
- buttonBrightness(onPressed: _onBrightness),
- buttonSettings(onPressed: viewModel.toSettings),
- buttonExit(onPressed: ()=>onButtonExit(viewModel)),
- ];
- }
- void _onBrightness()async{
- await viewModel.setIsBrightnessMax(!viewModel.isBrightnessMax);
- }
- Widget process() {
- return Obx(() => Text('${model.checkedCount}/${model.validCPAllNum}',
- maxLines: 1,
- style: const TextStyle(
- fontSize: 32,
- )));
- }
- Widget punchButton() {
- return Obx(
- () => SizedBox(
- width: 56,
- height: 56,
- child: ButtonPunch(
- onPressed: viewModel.isCheckCPButtonEnable
- ? viewModel.onCheckControlPoint
- : null,
- isWarn: viewModel.isCheckCPButtonWarn,
- ),
- ),
- );
- }
- }
|