|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | +import 'package:google_fonts/google_fonts.dart'; |
| 3 | +import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; |
| 4 | + |
| 5 | +List<TargetFocus> addTaskSwipeTutorialTargets({ |
| 6 | + required GlobalKey taskItemKey, |
| 7 | +}) { |
| 8 | + List<TargetFocus> targets = []; |
| 9 | + |
| 10 | + targets.add( |
| 11 | + TargetFocus( |
| 12 | + identify: "taskSwipeTutorial", |
| 13 | + keyTarget: taskItemKey, |
| 14 | + alignSkip: Alignment.bottomRight, |
| 15 | + radius: 10, |
| 16 | + shape: ShapeLightFocus.RRect, |
| 17 | + contents: [ |
| 18 | + TargetContent( |
| 19 | + align: ContentAlign.bottom, |
| 20 | + builder: (context, controller) { |
| 21 | + return Container( |
| 22 | + alignment: Alignment.center, |
| 23 | + child: Column( |
| 24 | + crossAxisAlignment: CrossAxisAlignment.center, |
| 25 | + mainAxisAlignment: MainAxisAlignment.center, |
| 26 | + children: <Widget>[ |
| 27 | + Text( |
| 28 | + "Task Swipe Actions", |
| 29 | + textAlign: TextAlign.center, |
| 30 | + style: GoogleFonts.poppins( |
| 31 | + color: Colors.white, |
| 32 | + fontWeight: FontWeight.bold, |
| 33 | + fontSize: 22.0, |
| 34 | + ), |
| 35 | + ), |
| 36 | + const SizedBox(height: 8), |
| 37 | + Text( |
| 38 | + "This is how you manage your tasks quickly : ", |
| 39 | + textAlign: TextAlign.center, |
| 40 | + style: GoogleFonts.poppins( |
| 41 | + color: Colors.white, |
| 42 | + fontStyle: FontStyle.italic, |
| 43 | + fontSize: 16.0, |
| 44 | + ), |
| 45 | + ), |
| 46 | + Padding( |
| 47 | + padding: const EdgeInsets.only(top: 16.0), |
| 48 | + child: Row( |
| 49 | + mainAxisAlignment: MainAxisAlignment.center, |
| 50 | + children: [ |
| 51 | + const Icon(Icons.arrow_right_alt, |
| 52 | + color: Colors.green, size: 28), |
| 53 | + const SizedBox(width: 8), |
| 54 | + Flexible( |
| 55 | + child: Text( |
| 56 | + "Swipe RIGHT to COMPLETE", |
| 57 | + textAlign: TextAlign.left, |
| 58 | + style: GoogleFonts.poppins( |
| 59 | + color: Colors.white, |
| 60 | + fontWeight: FontWeight.w500, |
| 61 | + ), |
| 62 | + ), |
| 63 | + ), |
| 64 | + ], |
| 65 | + ), |
| 66 | + ), |
| 67 | + Padding( |
| 68 | + padding: const EdgeInsets.only(top: 10.0), |
| 69 | + child: Row( |
| 70 | + mainAxisAlignment: MainAxisAlignment.center, |
| 71 | + children: [ |
| 72 | + const Icon(Icons.arrow_right_alt, |
| 73 | + textDirection: TextDirection.rtl, |
| 74 | + color: Colors.red, |
| 75 | + size: 28), |
| 76 | + const SizedBox(width: 8), |
| 77 | + Flexible( |
| 78 | + child: Text( |
| 79 | + "Swipe LEFT to DELETE", |
| 80 | + textAlign: TextAlign.left, |
| 81 | + style: GoogleFonts.poppins( |
| 82 | + color: Colors.white, |
| 83 | + fontWeight: FontWeight.w500, |
| 84 | + ), |
| 85 | + ), |
| 86 | + ), |
| 87 | + ], |
| 88 | + ), |
| 89 | + ), |
| 90 | + ], |
| 91 | + ), |
| 92 | + ); |
| 93 | + }, |
| 94 | + ), |
| 95 | + ], |
| 96 | + ), |
| 97 | + ); |
| 98 | + |
| 99 | + return targets; |
| 100 | +} |
0 commit comments