Deuque / overlay_tooltip

An overlay tooltip handler for onboarding
BSD 3-Clause "New" or "Revised" License
16 stars 26 forks source link

Issue in overlay #17

Closed PrimeTheFirst closed 1 month ago

PrimeTheFirst commented 1 month ago

Note: Behavior is very weird. Only the bottom bar works as expected. This is the bottom navbar

bottomNavigationBar: OverlayTooltipItem(
            tooltipVerticalPosition: TooltipVerticalPosition.TOP,
            displayIndex: 0,
            tooltip: (controller) {
              return  Padding(
                padding: const EdgeInsets.all(15.0),
                child: MTooltip(title: 'Navigation',description: "Welcome! Use this bar to navigate between different pages of the app.", controller: controller),
              );
             },
            child: BottomNavigationBar(...)

The first page

Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                OverlayTooltipItem(
                  tooltipVerticalPosition: TooltipVerticalPosition.BOTTOM,
                  displayIndex: 1,
                  tooltip: (controller) {
                    return Padding(
                      padding: const EdgeInsets.all(15.0),
                      child: MTooltip(
                          title: '..',
                          description:
                              "...",
                          controller: controller),
                    );
                  },
                  child: const Text(
                    '...',
                    style:
                        TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold),
                  ),
                ),
                const SizedBox(height: 16.0),
                OverlayTooltipItem(
                  tooltipVerticalPosition: TooltipVerticalPosition.BOTTOM,
                  displayIndex: 2,
                  tooltip: (controller) {
                    return Padding(
                      padding: const EdgeInsets.all(15.0),
                      child: MTooltip(
                          title: '...!',
                          description:
                              "..",
                          controller: controller),
                    );
                  },
                  child: TextField(
                    controller: tripName,
                    decoration: const InputDecoration(
                      labelText: '..',
                      border: OutlineInputBorder(),
                    ),
                  ),
                ),
                const SizedBox(height: 16.0),
                OverlayTooltipItem(
                  tooltipVerticalPosition: TooltipVerticalPosition.BOTTOM,
                  displayIndex: 3,
                  tooltip: (controller) {
                    return Padding(
                      padding: const EdgeInsets.all(15.0),
                      child: MTooltip(
                          title: '..',
                          description:
                              "...",
                          controller: controller),
                    );
                  },
                  child: TextField(
                    controller: tripDesc,
                    decoration: const InputDecoration(
                      labelText: '...',
                      border: OutlineInputBorder(),
                    ),
                  ),
                ),
                const SizedBox(height: 16.0),
                ElevatedButton(
                  onPressed: newTrip,
                  child: const Text('Submit'),
                ),
              ],

Output: WhatsApp Image 2024-10-07 at 12 24 11 PM (2) WhatsApp Image 2024-10-07 at 12 24 11 PM (1) WhatsApp Image 2024-10-07 at 12 24 11 PM

PrimeTheFirst commented 1 month ago

@Deuque

Deuque commented 1 month ago

@PrimeTheFirst What is the issue with what you have? Is it the padding?

Deuque commented 1 month ago

If the padding is the issue, you can try reducing the padding around the tooltip,


                return Padding(
                      padding: const EdgeInsets.all(15.0),
                      child: MTooltip(
                          title: '..',
                          description:
                              "...",
                          controller: controller),
                    );
PrimeTheFirst commented 1 month ago

@PrimeTheFirst What is the issue with what you have? Is it the padding?

No the inputs and text is not being highlighted. It should be white should it not as visible in the example? Expected: image

Deuque commented 1 month ago

@PrimeTheFirst Oh I see, you should add a background color to the widget, because the tooltip highlights the exact widget.

The tooltip doesn’t automatically add white colors, (imagine a scenario where someone wants a blue background)

So you need to design the exact widget you want to be highlighted. If you want a white background, just add a white background to the textfield

PrimeTheFirst commented 1 month ago

just add a white background to the textfield

@Deuque But I only want it to have that background color when the tooltip is on it. Not all the time

PrimeTheFirst commented 1 month ago

On testing it however, it is producing the expected output. Thanks!