Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. import 'dart:async';
  2. import 'package:flutter/material.dart';
  3. import 'package:giga_mobile/common/common.dart';
  4. import 'package:giga_mobile/common/navigation.dart';
  5. import 'package:giga_mobile/common/sizes.dart';
  6. import 'package:giga_mobile/common/string_image_asset.dart';
  7. import 'package:giga_mobile/ui/dashboard/dashboard_page.dart';
  8. import 'package:giga_mobile/ui/profile/profile.dart';
  9. import 'package:giga_mobile/ui/quest/quest.dart';
  10. import 'package:giga_mobile/ui/reward/reward.dart';
  11. import 'package:giga_mobile/widget/bottom_nav_bar/fab_bottom_app_bar.dart';
  12. import 'package:giga_mobile/widget/card/card_shop_list_maps.dart';
  13. import 'package:giga_mobile/widget/card/card_shop_maps.dart';
  14. import 'package:google_maps_flutter/google_maps_flutter.dart';
  15. import 'package:location/location.dart';
  16.  
  17. class MapsPage extends StatefulWidget {
  18. @override
  19. _MapsPageState createState() => _MapsPageState();
  20. }
  21.  
  22. class _MapsPageState extends State<MapsPage>
  23. with SingleTickerProviderStateMixin {
  24.  
  25. BitmapDescriptor _pinFoodLocationIcon;
  26.  
  27. void _setCustomMapPin() async {
  28. _pinFoodLocationIcon = await BitmapDescriptor.fromAssetImage(
  29. ImageConfiguration(devicePixelRatio: 2.5), StringImageAsset.markerFoods);
  30. }
  31.  
  32. @override
  33. void initState() {
  34. super.initState();
  35. _setCustomMapPin();
  36. _markers.add(
  37. Marker(
  38. markerId: MarkerId("13.780152, 100.544490"),
  39. position: LatLng(13.780152, 100.544490),
  40. icon: _pinFoodLocationIcon,
  41. onTap: () => _showModalBottomSheet(0),
  42. ),
  43. );
  44. }
  45.  
  46. @override
  47. void dispose() {
  48. super.dispose();
  49. }
  50.  
  51. @override
  52. Widget build(BuildContext context) {
  53. return Scaffold(
  54. body: SizedBox.expand(
  55. child: _googleMaps(),
  56. );
  57. }
  58.  
  59. Widget _googleMaps() {
  60. return GoogleMap(
  61. myLocationEnabled: true,
  62. mapType: MapType.normal,
  63. onMapCreated: _onMapCreated,
  64. zoomGesturesEnabled: true,
  65. initialCameraPosition: CameraPosition(
  66. target: LatLng(13.780264, 100.544975),
  67. zoom: 17.0,
  68. ),
  69. myLocationButtonEnabled: false,
  70. markers: _markers,
  71. );
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement