-
-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Talawa URL to Hamburger menu. (#2227)
* fetchmore bug fix in organizationlist widget * fetchmore result typecast * Refactor talawa conneciton url to hamburger menu * minor changes * minor fixes * minor fixes * minor fixes * added comments to the files mentioned in the failing test case. * added comments * minor fixes * ran build runner * fixed fail test * Bug fix: Edited tag does not get updated immediately (#2224) * Fixing bug to join or switch to any joined org (#2216) * Fixing bug to join or switch to any joined org * fixing linting errors * fixing * fixing coverage * fixing overflow error * fixing overflow error * Fixes Snackbar clipping by adding an auto scroll and duration based on length of message (#2231) * fix: Snackbar clipping by adding an auto scroll based on length of message * changes to tests and added documentation * minor changes to documentation * Navigation Services Test Written (#2230) * Navigation Services Test Written * Null Check Error Fixed * Update pull_request_template.md * Revert "Navigation Services Test Written (#2230)" (#2234) This reverts commit 23c2a74. * Refactor talawa conneciton url to hamburger menu * Bug fix: Edited tag does not get updated immediately (#2224) * Refactor talawa conneciton url to hamburger menu * Bug fix: Edited tag does not get updated immediately (#2224) * add some tests * added some tests * added tests to userConfig Service * fixed failing tests * fixed failing tests * added tests for explore_events_demo page * added comments for event_card widget * made add_post_page 100% code covered. * Refactor talawa conneciton url to hamburger menu * Navigation Services Test Written (#2230) * Navigation Services Test Written * Null Check Error Fixed * add tests to mainscreenviewModel * resolve conflicts * fixed failing test * added tests to apptour file --------- Co-authored-by: Bhav Khurana <96694482+bhav-khurana@users.noreply.github.com> Co-authored-by: Parag Gupta <103507835+Dante291@users.noreply.github.com> Co-authored-by: Hemanth Krishnakumar <72601105+Wreck-X@users.noreply.github.com> Co-authored-by: Manik Mehta <mehtamanik96@gmail.com> Co-authored-by: Peter Harrison <16875803+palisadoes@users.noreply.github.com>
- Loading branch information
1 parent
074859d
commit 40b35df
Showing
65 changed files
with
4,532 additions
and
1,140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:talawa/locator.dart'; | ||
import 'package:talawa/services/size_config.dart'; | ||
import 'package:talawa/view_model/main_screen_view_model.dart'; | ||
import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; | ||
|
||
/// Class that handles all the apptour routines. | ||
class AppTour { | ||
AppTour({ | ||
required this.model, | ||
}); | ||
|
||
///instance of mainscreenviewmodel. | ||
MainScreenViewModel model; | ||
|
||
///instance of tutorialCoachMark. | ||
late TutorialCoachMark tutorialCoachMark; | ||
|
||
/// This function show tutorial to user. | ||
/// | ||
/// **params**: | ||
/// * `onClickTarget`: Its a function which is required to run desired tasks on click. | ||
/// * `onFinish`: Its a function which is required to run desired tasks on finish | ||
/// | ||
/// | ||
/// **returns**: | ||
/// None | ||
void showTutorial({ | ||
required Function(TargetFocus) onClickTarget, | ||
required dynamic Function() onFinish, | ||
required List<FocusTarget> targets, | ||
}) { | ||
tutorialCoachMark = TutorialCoachMark( | ||
targets: targets.map((target) => target.focusWidget).toList(), | ||
colorShadow: Theme.of(model.context).colorScheme.secondaryContainer, | ||
textSkip: "SKIP", | ||
textStyleSkip: TextStyle( | ||
color: Theme.of(model.context).colorScheme.background, | ||
fontSize: 20, | ||
), | ||
paddingFocus: 10, | ||
opacityShadow: 1.0, | ||
onFinish: onFinish, | ||
onClickTarget: onClickTarget, | ||
onSkip: () { | ||
if (MainScreenViewModel.scaffoldKey.currentState!.isDrawerOpen) { | ||
navigationService.pop(); | ||
} | ||
model.tourSkipped = true; | ||
model.onTabTapped(0); | ||
return true; | ||
}, | ||
onClickOverlay: (target) { | ||
onClickTarget(target); | ||
}, | ||
); | ||
if (!model.testMode) tutorialCoachMark.show(context: model.context); | ||
} | ||
} | ||
|
||
/// Class that represents FocusTarget. | ||
class FocusTarget { | ||
/// This returns a widget for a step in a tutorial. | ||
/// | ||
/// **params**: | ||
/// * `key`: key of type GlobalKey. | ||
/// * `keyName`: key where the widget shows. | ||
/// * `description`: description of the step. | ||
/// * `isCircle`: bool to specify if circle | ||
/// * `align`: align of type ContentAlign to align button. | ||
/// * `crossAlign`: Cross align axes | ||
/// * `skipAlignment`: to give alignment of skip option | ||
/// * `next`: Function` type, this show the next step or `key` to show the tour of. | ||
/// * `nextCrossAlign`: nextCrossAlign to give alignment of next option | ||
/// * `isEnd`: true if last step of the tour. | ||
/// * `tutorialCoachMark`: instance of tutorialCoachMark to which this focusTarget is linked. | ||
FocusTarget({ | ||
required this.key, | ||
required this.keyName, | ||
required this.description, | ||
required this.appTour, | ||
this.isCircle = false, | ||
this.align = ContentAlign.bottom, | ||
this.crossAlign = CrossAxisAlignment.start, | ||
this.skipAlignment = Alignment.topRight, | ||
this.next, | ||
this.nextCrossAlign = CrossAxisAlignment.end, | ||
this.isEnd = false, | ||
}) { | ||
this.focusWidget = TargetFocus( | ||
enableOverlayTab: true, | ||
color: Colors.transparent, | ||
identify: keyName, | ||
keyTarget: key, | ||
alignSkip: skipAlignment, | ||
shape: isCircle ? ShapeLightFocus.Circle : ShapeLightFocus.RRect, | ||
contents: [ | ||
TargetContent( | ||
align: align, | ||
builder: (context, controller) { | ||
return Container( | ||
child: Column( | ||
mainAxisSize: MainAxisSize.max, | ||
crossAxisAlignment: crossAlign, | ||
children: <Widget>[ | ||
Text( | ||
description, | ||
style: TextStyle( | ||
color: Theme.of(context).colorScheme.secondary, | ||
fontSize: 20, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
), | ||
TargetContent( | ||
align: ContentAlign.custom, | ||
customPosition: CustomTargetContentPosition( | ||
bottom: SizeConfig.screenHeight! * 0.025, | ||
), | ||
builder: (context, controller) { | ||
return GestureDetector( | ||
onTap: () { | ||
// ignore: avoid_dynamic_calls | ||
next?.call(); | ||
|
||
appTour.tutorialCoachMark.next(); | ||
}, | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
crossAxisAlignment: nextCrossAlign, | ||
children: <Widget>[ | ||
Text( | ||
isEnd ? 'COMPLETE' : 'NEXT', | ||
style: TextStyle( | ||
color: Theme.of(context).colorScheme.secondary, | ||
fontSize: 20, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
); | ||
} | ||
|
||
/// represents the key of the target that is intended to be focused. | ||
GlobalKey key; | ||
|
||
/// keyName of the target in mainScreenViewModel. | ||
String keyName; | ||
|
||
/// description of the target. | ||
String description; | ||
|
||
/// true if focusing shape is circle. | ||
bool isCircle; | ||
|
||
/// alignment of description text. | ||
ContentAlign align; | ||
|
||
/// crossAxisAlignment. | ||
CrossAxisAlignment crossAlign; | ||
|
||
/// skip alignment configuration. | ||
Alignment skipAlignment; | ||
|
||
/// instance of AppTour. | ||
AppTour appTour; | ||
|
||
/// next callback that is executed on pressing this target. | ||
Function? next; | ||
|
||
/// next target's crossAxisAlignment. | ||
CrossAxisAlignment nextCrossAlign; | ||
|
||
/// true current target ends ths appTour. | ||
bool isEnd; | ||
|
||
/// Target focus widget with all above properties. | ||
late TargetFocus focusWidget; | ||
} |
Oops, something went wrong.