Merge branch 'dev' of github.com:VinistanSS/FCSC into dev

This commit is contained in:
venbaittech 2025-02-05 14:46:26 +05:30
commit b13aa81ad9

View File

@ -215,22 +215,7 @@ final _pb = PocketBase('https://pb.venbait.in');
late TutorialCoachMark tutorialCoachMark; late TutorialCoachMark tutorialCoachMark;
late List<TargetFocus> homeTargets; late List<TargetFocus> homeTargets;
late List<TargetFocus> previousHomeTargets; late List<TargetFocus> previousHomeTargets;
Offset _imageCardPosition =Offset.zero;
Offset _imageTopicPosition =Offset.zero;
void _calculateCardPosition() {
final RenderBox cardRenderBox = cardsKey.currentContext!.findRenderObject() as RenderBox;
final Offset cardPosition = cardRenderBox.localToGlobal(Offset.zero);
final Size cardSize = cardRenderBox.size;
// Calculate the position for the image
final double imageX = cardPosition.dx + cardSize.width / 2;
final double imageY = cardPosition.dy + cardSize.height;
setState(() {
_imageCardPosition = Offset(imageX, imageY);
});
}
void handleSkip() { void handleSkip() {
tutorialCoachMark.skip(); tutorialCoachMark.skip();
@ -246,6 +231,7 @@ final _pb = PocketBase('https://pb.venbait.in');
//Method waits app tour to render Targets //Method waits app tour to render Targets
void _starTourRender() { void _starTourRender() {
if (cardTopicKey.currentContext != null) { if (cardTopicKey.currentContext != null) {
print('render finished');
_showHomeTour(); _showHomeTour();
} else { } else {
Future.delayed(Duration(milliseconds: 100), _starTourRender); Future.delayed(Duration(milliseconds: 100), _starTourRender);
@ -261,7 +247,6 @@ final _pb = PocketBase('https://pb.venbait.in');
if (!homeTour) { if (!homeTour) {
// Show Home Tour // Show Home Tour
_initTarget(); _initTarget();
_calculateCardPosition();
tutorialCoachMark = TutorialCoachMark( tutorialCoachMark = TutorialCoachMark(
paddingFocus: 0, paddingFocus: 0,
useSafeArea: true, useSafeArea: true,
@ -272,7 +257,7 @@ final _pb = PocketBase('https://pb.venbait.in');
ref.read(homeTourProvider.notifier).state = true; ref.read(homeTourProvider.notifier).state = true;
ref.read(chartsTourProvider.notifier).state = false; ref.read(chartsTourProvider.notifier).state = false;
debugPrint('Home Tutorial Finished'); debugPrint('Home Tutorial Finished');
context.push('/marriages'); context.go('/chartScreen/hotels?bgColor=0xFF90B0D5&mainTopic=ECONOMY&title=Hotel+Establishments');
}, },
)..show(context: context); )..show(context: context);
} else if (!previousHomeTour) { } else if (!previousHomeTour) {
@ -286,7 +271,7 @@ final _pb = PocketBase('https://pb.venbait.in');
onFinish: () { onFinish: () {
ref.read(previousHomeTourProvider.notifier).state = true; ref.read(previousHomeTourProvider.notifier).state = true;
debugPrint('Previous Home Tutorial Finished'); debugPrint('Previous Home Tutorial Finished');
context.push('/marriages'); context.go('/chartScreen/hotels?bgColor=0xFF90B0D5&mainTopic=ECONOMY&title=Hotel+Establishments');
}, },
)..show(context: context); )..show(context: context);
} }
@ -294,30 +279,49 @@ final _pb = PocketBase('https://pb.venbait.in');
} }
void _initTarget(){ void _initTarget(){
final double screenWidth = MediaQuery.of(context).size.width;
homeTargets=[ homeTargets=[
TargetFocus( TargetFocus(
identify: 'cardTopicKey', identify: 'cardTopicKey',
keyTarget: cardTopicKey, keyTarget: cardTopicKey,
shape: ShapeLightFocus.RRect, shape: ShapeLightFocus.RRect,
radius: 8,
paddingFocus: 16,
contents: [ contents: [
createTargetContent( createTargetContent(
text: AppLocalizations.of(context)!.home_topic, text: AppLocalizations.of(context)!.home_topic,
alignment: ContentAlign.bottom, alignment: ContentAlign.bottom,
gap: 45, gap: 0,
space: 40, space: 43,
), ),
TargetContent( TargetContent(
align: ContentAlign.bottom, align: ContentAlign.bottom,
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height*0.69, height: MediaQuery.of(context).size.height*0.70,
child: Stack( child: Stack(
children: [ children: [
Positioned( Positioned(
bottom: 35, bottom: 20,
left: 16, left: 16,
right: 16, right: 16,
child: Row( child: Column(
children: [
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: const EdgeInsets.only(right: 10), // Adjust the value as needed
child: Text(
'1/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
),
),
SizedBox(height: 5,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
ElevatedButton( ElevatedButton(
@ -338,17 +342,8 @@ final _pb = PocketBase('https://pb.venbait.in');
), ),
), ),
), ),
Column(
children: [
Text(
'1/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
const SizedBox(height: 3),
Row( Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
const SizedBox(width: 10), const SizedBox(width: 10),
Container( Container(
@ -371,31 +366,26 @@ final _pb = PocketBase('https://pb.venbait.in');
], ],
), ),
], ],
), )
), ),
], ],
), ),
), ),
), ),
TargetContent( TargetContent(
padding: EdgeInsets.only(left: screenWidth * 0.4, bottom: 0),
align: ContentAlign.bottom, align: ContentAlign.bottom,
child: SizedBox( child: Container(
width: MediaQuery.of(context).size.width, width: 200,
height:MediaQuery.of(context).size.height*0.69 , height: 77,
child: Stack( child: Stack(
children: [ children: [
Positioned( Image.asset(
left: MediaQuery.of(context).size.width*0.4, 'assets/app_tour/right_down.png',
top: _imageCardPosition.dy-29, fit: BoxFit.contain,
child: Image.asset(
'assets/app_tour/down_right.png',
width: 40,
height: 90,
), ),
],
), ),
]
),
), ),
), ),
], ],
@ -404,13 +394,15 @@ final _pb = PocketBase('https://pb.venbait.in');
identify: 'cardsKey', identify: 'cardsKey',
keyTarget: cardsKey, keyTarget: cardsKey,
shape: ShapeLightFocus.RRect, shape: ShapeLightFocus.RRect,
radius: 7,
paddingFocus: 6,
// targetPosition:TargetPosition(),
contents: [ contents: [
createTargetContent( createTargetContent(
text:AppLocalizations.of(context)!.economy, text:AppLocalizations.of(context)!.economy,
alignment: ContentAlign.bottom, alignment: ContentAlign.bottom,
gap: 0, gap: 0,
space: 40,), space: 43,),
TargetContent( TargetContent(
align: ContentAlign.bottom, align: ContentAlign.bottom,
child: child:
@ -423,11 +415,27 @@ final _pb = PocketBase('https://pb.venbait.in');
bottom: 25, bottom: 25,
left: 16, left: 16,
right: 16, right: 16,
child: Row( child: Column(
children: [
Align(
alignment: Alignment.bottomRight,
child:Padding(padding: EdgeInsets.only(right: 10),
child:
Text(
'2/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
)
),
const SizedBox(height: 3),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
ElevatedButton( ElevatedButton(
onPressed: () =>handleSkip, onPressed: () =>handleSkip(),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
@ -444,16 +452,6 @@ final _pb = PocketBase('https://pb.venbait.in');
), ),
), ),
), ),
Column(
children: [
Text(
'2/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
const SizedBox(height: 3),
Row( Row(
children: [ children: [
Container( Container(
@ -496,43 +494,62 @@ final _pb = PocketBase('https://pb.venbait.in');
), ),
), ),
TargetContent( TargetContent(
padding: EdgeInsets.only(left: screenWidth * 0.4, bottom: 0),
align: ContentAlign.bottom, align: ContentAlign.bottom,
child: SizedBox( child: Container(
width: MediaQuery.of(context).size.width , width: 200,
height:MediaQuery.of(context).size.height*0.69 , height: 77,
child: Stack( child: Stack(
children: [ children: [
Positioned( Image.asset(
left: MediaQuery.of(context).size.width*0.40, 'assets/app_tour/right_down.png',
top: _imageTopicPosition.dy-29, fit: BoxFit.contain,
child: Image.asset( ),
'assets/app_tour/down_right.png', ],
width: 40,
height: 90,
), ),
), ),
]
),
),
), ),
// TargetContent(
// align: ContentAlign.bottom,
// child: SizedBox(
// width: MediaQuery.of(context).size.width ,
// height:MediaQuery.of(context).size.height*0.69 ,
// child: Stack(
// children: [
// Positioned(
// left: MediaQuery.of(context).size.width*0.40,
// top: _imageTopicPosition.dy-29,
// child: Image.asset(
// 'assets/app_tour/right_down.png',
// width: 40,
// height: 90,
// ),
// ),
// ]
// ),
//
// ),
// ),
], ],
), ),
]; ];
} }
void _initPreviousTarget(){ void _initPreviousTarget(){
final double screenWidth = MediaQuery.of(context).size.width;
previousHomeTargets=[ previousHomeTargets=[
TargetFocus( TargetFocus(
identify: 'cardsKey', identify: 'cardsKey',
keyTarget: cardsKey, keyTarget: cardsKey,
shape: ShapeLightFocus.RRect, shape: ShapeLightFocus.RRect,
radius: 7,
paddingFocus: 6,
contents: [ contents: [
createTargetContent( createTargetContent(
text:AppLocalizations.of(context)!.economy, text:AppLocalizations.of(context)!.economy,
alignment: ContentAlign.bottom, alignment: ContentAlign.bottom,
gap: 0, gap: 0,
space: 40,), space: 43,),
TargetContent( TargetContent(
align: ContentAlign.bottom, align: ContentAlign.bottom,
child: child:
@ -545,7 +562,23 @@ final _pb = PocketBase('https://pb.venbait.in');
bottom: 25, bottom: 25,
left: 16, left: 16,
right: 16, right: 16,
child: Row( child: Column(
children: [
Align(
alignment: Alignment.bottomRight,
child:Padding(padding: EdgeInsets.only(right: 10),
child:
Text(
'2/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
)
),
SizedBox(height: 5,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
ElevatedButton( ElevatedButton(
@ -566,16 +599,9 @@ final _pb = PocketBase('https://pb.venbait.in');
), ),
), ),
), ),
Column( Row(
children: [ children: [
Text(
'2/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
const SizedBox(height: 3),
Row( Row(
children: [ children: [
Container( Container(
@ -603,6 +629,7 @@ final _pb = PocketBase('https://pb.venbait.in');
onPressed: () { onPressed: () {
ref.read(previousHomeTourProvider.notifier).state=true; ref.read(previousHomeTourProvider.notifier).state=true;
ref.read(chartsTourProvider.notifier).state=false; ref.read(chartsTourProvider.notifier).state=false;
context.go('/chartScreen/hotels?bgColor=0xFF90B0D5&mainTopic=ECONOMY&title=Hotel+Establishments');
tutorialCoachMark.finish(); tutorialCoachMark.finish();
}, },
), ),
@ -613,30 +640,27 @@ final _pb = PocketBase('https://pb.venbait.in');
), ),
], ],
), ),
],
),
), ),
], ],
), ),
), ),
), ),
TargetContent( TargetContent(
padding: EdgeInsets.only(left: screenWidth * 0.4, bottom: 0),
align: ContentAlign.bottom, align: ContentAlign.bottom,
child: SizedBox( child: Container(
width: MediaQuery.of(context).size.width, width: 200,
height:MediaQuery.of(context).size.height*0.69 , height: 77,
child: Stack( child: Stack(
children: [ children: [
Positioned( Image.asset(
left: MediaQuery.of(context).size.width*0.40, 'assets/app_tour/right_down.png',
top: _imageTopicPosition.dy-29, fit: BoxFit.contain,
child: Image.asset(
'assets/app_tour/down_right.png',
width: 40,
height: 90,
), ),
],
), ),
]
),
), ),
), ),
], ],
@ -645,12 +669,14 @@ final _pb = PocketBase('https://pb.venbait.in');
identify: 'cardTopicKey', identify: 'cardTopicKey',
keyTarget: cardTopicKey, keyTarget: cardTopicKey,
shape: ShapeLightFocus.RRect, shape: ShapeLightFocus.RRect,
radius: 8,
paddingFocus: 16,
contents: [ contents: [
createTargetContent( createTargetContent(
text:AppLocalizations.of(context)!.home_topic, text:AppLocalizations.of(context)!.home_topic,
alignment: ContentAlign.bottom, alignment: ContentAlign.bottom,
gap: 45, gap: 0,
space: 40, space: 43,
), ),
TargetContent( TargetContent(
align: ContentAlign.bottom, align: ContentAlign.bottom,
@ -660,10 +686,25 @@ final _pb = PocketBase('https://pb.venbait.in');
child: Stack( child: Stack(
children: [ children: [
Positioned( Positioned(
bottom: 35, bottom: 20,
left: 16, left: 16,
right: 16, right: 16,
child: Row( child: Column(
children: [
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding:EdgeInsets.only(right: 10),
child: Text(
'1/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
ElevatedButton( ElevatedButton(
@ -687,16 +728,6 @@ final _pb = PocketBase('https://pb.venbait.in');
), ),
), ),
), ),
Column(
children: [
Text(
'1/7',
style: const TextStyle(
color: Colors.white,
fontSize: 14,
),
),
const SizedBox(height: 3),
Row( Row(
children: [ children: [
const SizedBox(width: 10), const SizedBox(width: 10),
@ -726,24 +757,19 @@ final _pb = PocketBase('https://pb.venbait.in');
), ),
), ),
TargetContent( TargetContent(
padding: EdgeInsets.only(left: screenWidth * 0.4, bottom: 0),
align: ContentAlign.bottom, align: ContentAlign.bottom,
child: SizedBox( child: Container(
width: MediaQuery.of(context).size.width, width: 200,
height:MediaQuery.of(context).size.height*0.69 , height: 77,
child: Stack( child: Stack(
children: [ children: [
Positioned( Image.asset(
left: MediaQuery.of(context).size.width*0.4, 'assets/app_tour/right_down.png',
top: _imageCardPosition.dy-29, fit: BoxFit.contain,
child: Image.asset(
'assets/app_tour/down_right.png',
width: 40,
height: 90,
), ),
],
), ),
]
),
), ),
), ),
], ],