CPラベルが1文字しか出ない、起動が遅い
This commit is contained in:
@ -6,7 +6,9 @@ import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/services/maxtrix_service.dart';
|
||||
import 'package:rogapp/utils/const.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheet_new.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheets/bottom_sheet_start.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheets/bottom_sheet_goal.dart';
|
||||
import 'package:rogapp/widgets/bottom_sheets/bottom_sheet_normal_point.dart';
|
||||
|
||||
class ListWidget extends StatefulWidget {
|
||||
const ListWidget({Key? key}) : super(key: key);
|
||||
@ -15,6 +17,15 @@ class ListWidget extends StatefulWidget {
|
||||
State<ListWidget> createState() => _ListWidgetState();
|
||||
}
|
||||
|
||||
// IndexControllerから目的地のリストを取得し、ListView.builderを使用してリストを表示します。
|
||||
// 各リストアイテムは、目的地の画像、名前、カテゴリ、サブロケーションID、現在地からの距離を表示します。
|
||||
// リストアイテムがタップされると、changeCurrentFeatureメソッドを呼び出して現在の目的地を更新し、 BottomSheetウィジェットを表示します。
|
||||
// 主なロジック:
|
||||
// IndexControllerから目的地のリストを取得し、ListView.builderを使用してリストを構築します。
|
||||
// getImageメソッドを使用して、目的地の画像を取得し表示します。画像が存在しない場合は、デフォルトの画像を表示します。
|
||||
// matrixDistanceメソッドを使用して、現在地から目的地までの距離を計算し表示します。
|
||||
// リストアイテムがタップされると、changeCurrentFeatureメソッドを呼び出して現在の目的地を更新し、showModalBottomSheetを使用してBottomSheetウィジェットを表示します。
|
||||
//
|
||||
class _ListWidgetState extends State<ListWidget> {
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
@ -42,6 +53,7 @@ class _ListWidgetState extends State<ListWidget> {
|
||||
}
|
||||
}
|
||||
|
||||
// 未使用?
|
||||
void changeCurrentFeature(GeoJSONFeature fs) {
|
||||
if (indexController.currentFeature.isNotEmpty) {
|
||||
indexController.currentFeature.clear();
|
||||
@ -117,15 +129,23 @@ class _ListWidgetState extends State<ListWidget> {
|
||||
Destination des =
|
||||
destinationController.festuretoDestination(gf);
|
||||
changeCurrentFeature(gf);
|
||||
|
||||
Widget bottomSheet;
|
||||
if (des.cp == -1 || des.cp == 0) {
|
||||
bottomSheet = BottomSheetStart(destination: des);
|
||||
} else if (des.cp == -2 || des.cp == 0) {
|
||||
bottomSheet = BottomSheetGoal(destination: des);
|
||||
} else {
|
||||
bottomSheet = BottomSheetNormalPoint(destination: des);
|
||||
}
|
||||
|
||||
showModalBottomSheet(
|
||||
constraints: BoxConstraints.loose(
|
||||
Size(Get.width, Get.height * 0.85)),
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
//builder: (context) => BottomSheetWidget(),
|
||||
builder: ((context) => BottomSheetNew(
|
||||
destination: des,
|
||||
)));
|
||||
builder: ((context) => bottomSheet ),
|
||||
);
|
||||
},
|
||||
leading: getImage(index),
|
||||
title: indexController.locations[0].features[index]!
|
||||
|
||||
Reference in New Issue
Block a user