circle_wheel_scroll icon indicating copy to clipboard operation
circle_wheel_scroll copied to clipboard

Detect Pressed Item

Open OmarHatem28 opened this issue 5 years ago • 9 comments

Greetings, I have tried to wrap the children of CircleListScrollView widget with GestureDetector and FlatButton to execute onTap or onPressed callbacks but none of them is getting called. Also I tried to do the same in ListWheelScrollView and got the same result. Is there a way to detect the pressed item in the list or just by using onSelectedItemChanged ?

Capture

OmarHatem28 avatar Apr 17 '19 10:04 OmarHatem28

Same problem here with InkWell

sachaarbonel avatar May 12 '19 12:05 sachaarbonel

can i initial the wheel with a given start index?

ellis-wang avatar May 31 '19 04:05 ellis-wang

CircleWheelScroll Accepts initialIndex

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: ellis-wang [email protected] Sent: Friday, May 31, 2019 7:17:31 AM To: DenisBogatirov/circle_wheel_scroll Cc: Subscribed Subject: Re: [DenisBogatirov/circle_wheel_scroll] Detect Pressed Item (#2)

can i initial the wheel with a given start index?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/DenisBogatirov/circle_wheel_scroll/issues/2?email_source=notifications&email_token=ADD564VWLZ75D3HM2XGV7RDPYCRFXA5CNFSM4HGSZOR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWUE24A#issuecomment-497569136, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADD564TGSCTNTEPKWZQ7HH3PYCRFXANCNFSM4HGSZORQ.

DenisBogatirov avatar May 31 '19 08:05 DenisBogatirov

hi guys, that mean we can't click on the circle ? or there is a ways ?

Yuiie avatar Jun 26 '19 16:06 Yuiie

I'm afraid that issue with gesture detection are connected with ListWheelScrollView (on which my widget is based on). I've changed my example to use ListWheelScrollView, and didn't get anything from GestureDetector. Here is code

import 'package:flutter/material.dart';

class WheelExample extends StatelessWidget {
  Widget _buildItem(BuildContext context, int i) {
    return GestureDetector(
      onTap: () { print('TAP ON ITEM'); },
          child: Center(
        child: ClipRRect(
          borderRadius: BorderRadius.circular(40),
          child: Container(
            width: 80,
            padding: EdgeInsets.all(20),
            color: Colors.blue[100 * ((i % 8) + 1)],
            child: Center(
              child: Text(
                i.toString(),
              ),
            ),
          ),
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Wheel example'),
      ),
      body: SafeArea(
        child: Center(
          child: Container(
            child: ListWheelScrollView.useDelegate(
              itemExtent: 80,
              childDelegate: ListWheelChildBuilderDelegate(
                childCount: 10,
                builder: _buildItem,
              ),
            ),
          ),
        ),
      ),
    );
  }
}


class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: WheelExample(),
    );
  }
}

void main() => runApp(MyApp());

Feel free to open issue on flutter repo.

DenisBogatirov avatar Jul 03 '19 11:07 DenisBogatirov

I have the same problem. Does anyone know any solution?

spiderion avatar Sep 09 '19 21:09 spiderion

Same problem

abbas-azadi avatar Nov 19 '20 05:11 abbas-azadi

same problem, list does not let the item in it detect the tap. Any work around?

rizzellodavide avatar Dec 16 '20 11:12 rizzellodavide

Any work around??

marah222 avatar Dec 21 '23 08:12 marah222