Files
Regroup/lib/Feed Module/Main_Screens/ExploreDesign/ExploreScreen.dart
2024-06-28 19:11:00 +05:30

341 lines
11 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:regroup/Common/CommonGlassmorphism.dart';
import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
import 'package:regroup/Utils/Common/blureffect.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
import 'package:regroup/Common/global.dart' as global;
import 'package:regroup/resources/routes/route_name.dart';
class ExploreScreen extends StatefulWidget {
const ExploreScreen({super.key});
@override
State<ExploreScreen> createState() => _ExploreScreenState();
}
class _ExploreScreenState extends State<ExploreScreen> {
GoogleMapController? _mapController;
double _zoomLevel = 18.0;
// BitmapDescriptor? _customIcon1;
// BitmapDescriptor? _customIcon2;
@override
void initState() {
super.initState();
// _loadCustomMarkers();
global.getLocation();
_showInitialBottomSheet();
}
// void _loadCustomMarkers() async {
// _customIcon1 = await BitmapDescriptor.fromAssetImage(
// ImageConfiguration(size: Size(48, 48)),
// 'assets/images/png/Group 58613.png',
// );
// _customIcon2 = await BitmapDescriptor.fromAssetImage(
// ImageConfiguration(size: Size(48, 48)),
// 'assets/images/custom_marker2.png',
// );
// setState(() {});
// }
Future<void> _showInitialBottomSheet() async {
await Future.delayed(Duration(milliseconds: 400));
exploreBottomSheet();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFF222935),
extendBody: true,
// appBar: CommonAppbar(
// titleTxt: "",
// ),
body: Stack(children: [
const CommonBlurLeftRed(),
const CommonBlurRightRed(),
const CommonBlurLeft(),
const CommonBlurRight(),
Positioned.fill(
child: Stack(children: [
GoogleMap(
mapType: MapType.normal,
mapToolbarEnabled: true,
onMapCreated: (controller) {
_mapController = controller;
_mapController!.animateCamera(
CameraUpdate.newCameraPosition(
CameraPosition(
target: global.latlong!,
zoom: _zoomLevel,
),
),
);
},
zoomControlsEnabled: false,
initialCameraPosition: CameraPosition(
target: global.latlong!,
zoom: _zoomLevel,
),
markers: {
Marker(
markerId: MarkerId('currentP'),
icon: BitmapDescriptor.defaultMarker,
position: global.latlong!,
onTap: () {
exploreBottomSheet2();
},
),
Marker(
markerId: MarkerId('currentP'),
icon: BitmapDescriptor.defaultMarker,
position: LatLng(19.155001, 72.84998),
onTap: () {
exploreBottomSheet2();
},
),
},
),
Positioned(
top: 50.h,
right: 0,
left: 0,
child: GestureDetector(
onTap: () {
Get.toNamed(RouteName.searchgroup);
},
child: AbsorbPointer(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16),
child: CustomTextFormField(
leadingIcon: SizedBox(
height: 23,
width: 23,
child: Center(
child: Image.asset(
"assets/images/png/ion_search-outline.png",
height: 23,
width: 23,
),
),
),
hintText: "Search groups",
),
),
),
))
]))
]));
}
void exploreBottomSheet2() {
Get.bottomSheet(
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.r),
topRight: Radius.circular(10.r),
),
color: Color(0xFF222935),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
sizedBoxHeight(10.h),
Stack(clipBehavior: Clip.none, children: [
Container(
height: 130.h,
width: double.infinity,
decoration:
BoxDecoration(borderRadius: BorderRadius.circular(5.r)),
child: Image.asset(
"assets/images/png/Rectangle 32.png",
fit: BoxFit.cover,
),
),
Positioned(
bottom: -40.h,
right: 0,
left: 0,
child: Align(
alignment: Alignment.center,
child: Container(
height: 85.h,
width: 85.w,
decoration: BoxDecoration(
shape: BoxShape.circle,
),
child: Image.asset("assets/images/png/Ellipse 37.png",
fit: BoxFit.cover),
),
))
]),
sizedBoxHeight(50.h),
text20w700_FCFCFC("Iron titans fitness crew"),
sizedBoxHeight(25.h),
text14400whiteblur(
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
textAlign: TextAlign.center),
sizedBoxHeight(25.h),
commonDivider(),
sizedBoxHeight(25.h),
Row(
children: [
commonGlassContainer(
width: 30.w,
height: 30.h,
borderradius: 100,
customWidget: Center(
child: Image.asset(
"assets/images/png/community 1 (traced).png",
height: 18.h,
width: 18.w,
),
),
border: 0.5),
sizedBoxWidth(10.w),
text16400white("10 subgroups "),
Spacer(),
commonGlassContainer(
width: 30.w,
height: 30.h,
borderradius: 100,
customWidget: Center(
child: Image.asset(
"assets/images/png/ph_users-light.png",
height: 18.h,
width: 18.w,
)),
border: 0.5),
sizedBoxWidth(10.w),
text16400white("7 members"),
],
),
sizedBoxHeight(30.h),
Row(
children: [
commonGlassContainer(
width: 170.w,
height: 35.h,
opacity1: 0.05,
opacity2: 0.07,
borderradius: 30.r,
customWidget: Center(child: text14w400_FCFCFC("Message")),
border: 1),
Spacer(),
Container(
width: 170.w,
height: 35.h,
decoration: BoxDecoration(
color: Color(0xFFD90B2E),
borderRadius: BorderRadius.circular(30.r)),
child: Center(child: text14400white("Visit group")),
),
],
),
sizedBoxHeight(30.h)
],
),
),
),
);
}
void exploreBottomSheet() {
List exploreData = [
{
"imagePath": "assets/images/png/Rectangle 29.png",
"title": "Iron titans fitness crew",
"subtitle": "Elm street london, United Kingdom"
},
{
"imagePath": "assets/images/png/Rectangle 31ee.png",
"title": "Iron titans fitness crew",
"subtitle": "Elm street london, United Kingdom"
},
{
"imagePath": "assets/images/png/Rectangle 45.png",
"title": "Iron titans fitness crew",
"subtitle": "Elm street london, United Kingdom"
},
];
Get.bottomSheet(
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.r),
topRight: Radius.circular(10.r),
),
color: Color(0xFF222935),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
sizedBoxHeight(20.h),
text18w700_FCFCFC('Explore groups and business'),
sizedBoxHeight(25.h),
Column(
children: List.generate(exploreData.length, (index) {
return Column(
children: [
rowtile(
imagePath: exploreData[index]["imagePath"],
title: exploreData[index]["title"],
subtitle: exploreData[index]["subtitle"]),
if (exploreData.length - 1 != index) commonDivider(),
],
);
}),
),
sizedBoxHeight(30.h),
],
),
),
),
);
}
Widget rowtile(
{required String imagePath,
required String title,
required String subtitle}) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 15.h),
child: Row(
children: [
Container(
height: 50.h,
width: 50.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.r),
),
child: Image.asset(imagePath),
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16w400_FCFCFC(title),
sizedBoxHeight(6.h),
text12400whiteblur(subtitle),
],
)
],
),
);
}
}