Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
map_app_bar.dart
Go to the documentation of this file.
1import 'package:easy_localization/easy_localization.dart';
2import 'package:fluentui_system_icons/fluentui_system_icons.dart';
3import 'package:flutter/material.dart';
4import 'package:flutter_screenutil/flutter_screenutil.dart';
5import 'package:google_maps_flutter/google_maps_flutter.dart';
6import 'package:maps_launcher/maps_launcher.dart';
7
8import '../../../../../../core/common/enums/collection_status.dart';
9import '../../../../../../core/ui/theme/color_palette.dart';
10
11class MapAppBar extends StatelessWidget {
13 final bool showTitle;
14 final String lat;
15 final String lng;
16
17 const MapAppBar({
18 super.key,
19 required this.status,
20 required this.showTitle,
21 required this.lat,
22 required this.lng,
23 });
24
25 @override
26 Widget build(BuildContext context) {
27 return SliverAppBar(
28 title: AnimatedOpacity(
29 duration: const Duration(milliseconds: 300),
30 opacity: showTitle ? 1.0 : 0.0,
31 child: Text(
32 'common.collection_request'.tr(),
33 style: Theme.of(context).textTheme.titleMedium?.copyWith(
35 fontWeight: FontWeight.w600,
36 ),
37 ),
38 ),
39 expandedHeight: 190.h,
40 floating: false,
41 pinned: true,
42 backgroundColor: ColorPalette.white,
43 elevation: 0.2,
44 leading: Padding(
45 padding: EdgeInsets.all(8.sp),
46 child: Container(
47 decoration: BoxDecoration(
49 borderRadius: BorderRadius.circular(12),
50 boxShadow: [
51 BoxShadow(
52 color: ColorPalette.black.withValues(alpha:0.08),
53 blurRadius: 8,
54 offset: const Offset(0, 2),
55 ),
56 ],
57 ),
58 child: IconButton(
59 highlightColor: ColorPalette.lightGreen.withValues(alpha:0.2),
60 icon: const Icon(Icons.arrow_back_rounded),
62 onPressed: () => Navigator.pop(context),
63 ),
64 ),
65 ),
66 actions: status == CollectionStatus.onTheWay ? [
67 Padding(
68 padding: EdgeInsets.all(8.sp),
69 child: Container(
70 decoration: BoxDecoration(
72 borderRadius: BorderRadius.circular(12),
73 boxShadow: [
74 BoxShadow(
75 color: ColorPalette.black.withValues(alpha:0.08),
76 blurRadius: 8,
77 offset: const Offset(0, 2),
78 ),
79 ],
80 ),
81 child: IconButton(
82 highlightColor: ColorPalette.lightGreen.withValues(alpha:0.2),
83 icon: const Icon(FluentIcons.location_arrow_12_regular),
85 onPressed: () {
86 MapsLauncher.launchCoordinates(
87 double.parse(lat),
88 double.parse(lng),
89 );
90 },
91 ),
92 ),
93 ),
94 ] : null,
95 flexibleSpace: FlexibleSpaceBar(
96 background: SizedBox(
97 height: 190.h,
98 child: GoogleMap(
99 initialCameraPosition: CameraPosition(
100 target: LatLng(double.parse(lat), double.parse(lng)),
101 zoom: 15,
102 ),
103 mapType: MapType.normal,
104 myLocationButtonEnabled: false,
105 zoomControlsEnabled: false,
106 scrollGesturesEnabled: false,
107 zoomGesturesEnabled: false,
108 rotateGesturesEnabled: false,
109 tiltGesturesEnabled: false,
110 markers: {
111 Marker(
112 markerId: const MarkerId('1'),
113 position: LatLng(double.parse(lat), double.parse(lng)),
114 )
115 },
116 ),
117 ),
118 ),
119 );
120 }
121}
static const lightGreen
static const black
static const white
final String lat
final VoidCallback onPressed
final Set< Marker > markers
final String title
final Widget child
override Widget build(BuildContext context)
final CollectionStatus status
const MapAppBar({ super.key, required this.status, required this.showTitle, required this.lat, required this.lng, })
final EdgeInsets padding
final bool showTitle
final String lng
CollectionStatus
class Partner String
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)
style SizedBox(height:2.h)