| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import 'package:trackoffical_app/service/game/game_model.dart';
- import 'package:trackoffical_app/service/user_profile.dart';
- import 'package:trackoffical_app/view/ingame/layer_cp_touch.dart';
- import 'package:trackoffical_app/view/ingame/layer_map.dart';
- import '../../service/game/game.dart';
- import 'package:trackoffical_app/widget/will_exit_after_2_back.dart';
- import '../../service/app.dart';
- import '../../service/mock.dart';
- import './in_game_controller.dart';
- import '../../styles/color_schemes.g.dart';
- import 'in_game_no_map_view.dart';
- import 'layer_front_ui.dart';
- import 'layer_warn.dart';
- class InGameView extends GetView<InGameController> {
- const InGameView({super.key});
- static Bindings bindings() {
- return BindingsBuilder(() {
- Get.lazyPut<InGameController>(() => InGameController());
- });
- }
- @override
- Widget build(BuildContext context) {
- return WillExitAfter2Back(
- child: Obx(() => controller.uiMode.value!=GameUIMode.electronicMap? InGameNoMapView(): Scaffold(
- backgroundColor: const Color(0xffd6d6d6),
- body: Stack(
- children: [
- const LayerMap(),
- const LayerWarn(),
- _LayerMapTouch(),
- const LayerCPTouch(),
- LayerFrontUI(),
- ],
- ),
- )) );
- }
- }
- class _LayerMapTouch extends GetView<GameService> {
- @override
- Widget build(BuildContext context) {
- return GestureDetector(
- onScaleStart: (v) => controller.mapStatus.onMapTouchScaleStart(v),
- onScaleUpdate: (v) => controller.mapStatus
- .onMapTouchScaleUpdate(v, Size(context.width, context.height)),
- onScaleEnd: (v) => controller.mapStatus.isTouching = false,
- child: SizedBox.expand(
- child: Container(color: Colors.transparent),
- ),
- );
- }
- }
- void main() async {
- Mock.initServices();
- await App.to.init();
- Get.put(GameModel());
- Get.put(GameService());
- await GameService.to.gameStart();
- // await GameService.to.gameLoad();
- var c = InGameControllerMock();
- Get.put<InGameController>(c);
- runApp(GetMaterialApp(
- theme: ThemeData(useMaterial3: true, colorScheme: lightColorScheme),
- home: const InGameView()));
- }
|