mapbox / mapbox/mapbox-maps-flutter

Could see map box on emulator

Open
#276 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

Here is the screen shot of emulator which show the performance bar of map box but the map is not visible. But works on real device.

Screenshot_1697547978

import 'package:flutter/material.dart';
import 'package:map_box_test/next.dart';
import 'package:mapbox_maps_flutter/mapbox_maps_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
          seedColor: Colors.deepPurple,
        ),
        useMaterial3: true,
      ),
      home: const FullMap(),
    );
  }
}

class FullMap extends StatefulWidget {
  const FullMap({super.key});

  @override
  State createState() => FullMapState();
}

class FullMapState extends State<FullMap> {
  MapboxMap? mapboxMap;

  _onMapCreated(MapboxMap mapboxMap) {
    this.mapboxMap = mapboxMap;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        bottomSheet: DraggableScrollableSheet(
          expand: false,
          builder: (context, scrollController) => Container(
            color: Colors.amber,
            child: SingleChildScrollView(
              controller: scrollController,
              child: const Column(
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: [
                  SizedBox(
                    height: 100,
                    child: Card(
                      color: Colors.grey,
                    ),
                  )
                ],
              ),
            ),
          ),
        ),
        appBar: AppBar(
          title: const Text("MapBox"),
          actions: [
            GestureDetector(
                onTap: () {
                  Navigator.push(
                      context,
                      CupertinoPageRoute(
                        builder: (context) => const MyWidget(),
                      ));
                },
                child: const Icon(Icons.arrow_forward))
          ],
        ),
        body: MapWidget(
          key: const ValueKey("mapWidget"),
          resourceOptions: ResourceOptions(
              accessToken:
                  "MY_SECRET_KEY"),
          onMapCreated: _onMapCreated,
        ));
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided MapWidget example on an emulator and comparing it with a real-device run. Check the emulator configuration and the map rendering setup shown in the issue; done means identifying why the performance bar appears while the map does not and documenting or fixing the reproducible cause.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.