接入地图SDK
This commit is contained in:
@@ -77,7 +77,7 @@ void initHttpSet() {
|
||||
return null;
|
||||
} else if (baseModel.code == 401) {
|
||||
await StorageService.to.clearLoginInfo();
|
||||
Get.offAll(() => const LoginPage());
|
||||
// Get.offAll(() => const LoginPage());
|
||||
return baseModel.message;
|
||||
} else {
|
||||
return (baseModel.error.toString()).isEmpty
|
||||
|
||||
58
ln_jq_app/lib/pages/c_page/base_widgets/NativePageIOS.dart
Normal file
58
ln_jq_app/lib/pages/c_page/base_widgets/NativePageIOS.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class NativePageIOS extends StatelessWidget {
|
||||
const NativePageIOS({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (Platform.isIOS) {
|
||||
return Container(
|
||||
// onTap: () => _handleTap(context),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.width - 100,
|
||||
// padding: EdgeInsetsGeometry.all(15),
|
||||
color: Colors.red[100],
|
||||
|
||||
child: UiKitView(
|
||||
viewType: 'NativeFirstPage', // 与原生端注册的标识一致
|
||||
gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{}.toSet(),
|
||||
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
layoutDirection: TextDirection.ltr,
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return const Center(child: Text('not ios'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _handleTap(BuildContext context) {
|
||||
print("页面被点击");
|
||||
_showDialog(context, 'Tip', '点击了');
|
||||
}
|
||||
|
||||
|
||||
void _showDialog(BuildContext context, String title, String content) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(title),
|
||||
content: Text(content),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: const Text('确定'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:getx_scaffold/getx_scaffold.dart';
|
||||
import 'package:ln_jq_app/common/login_util.dart';
|
||||
import 'package:ln_jq_app/pages/c_page/base_widgets/NativePageIOS.dart';
|
||||
import 'package:ln_jq_app/pages/c_page/car_info/view.dart';
|
||||
import 'package:ln_jq_app/pages/c_page/map/view.dart';
|
||||
import 'package:ln_jq_app/pages/c_page/mine/view.dart';
|
||||
@@ -33,7 +34,7 @@ class BaseWidgetsPage extends GetView<BaseWidgetsController> {
|
||||
}
|
||||
|
||||
List<Widget> _buildPages() {
|
||||
return [ReservationPage(), MapPage(), CarInfoPage(), MinePage()];
|
||||
return [ReservationPage(), NativePageIOS(), CarInfoPage(), MinePage()];
|
||||
}
|
||||
|
||||
// 自定义导航栏 (悬浮胶囊样式)
|
||||
|
||||
@@ -43,7 +43,8 @@ class HomeController extends GetxController with BaseControllerMixin {
|
||||
}
|
||||
} else {
|
||||
// 未登录,直接去登录页
|
||||
return LoginPage();
|
||||
return BaseWidgetsPage();
|
||||
// return LoginPage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user