DenisBogatirov / circle_wheel_scroll

Circle wheel scroll view for flutter
BSD 3-Clause "New" or "Revised" License
35 stars 47 forks source link

Detect Pressed Item #2

Open OmarHatem28 opened 5 years ago

OmarHatem28 commented 5 years ago

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

sachaarbonel commented 5 years ago

Same problem here with InkWell

ellis-wang commented 5 years ago

can i initial the wheel with a given start index?

DenisBogatirov commented 5 years ago

CircleWheelScroll Accepts initialIndex

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


From: ellis-wang notifications@github.com 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.

Yuiie commented 5 years ago

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

DenisBogatirov commented 5 years ago

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.

spiderion commented 5 years ago

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

abbas-azadi commented 3 years ago

Same problem

rizzellodavide commented 3 years ago

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

marah222 commented 10 months ago

Any work around??

Shashwat-111 commented 1 month ago

No solutions yet?