skip to Main Content

the clickable cards if I click only once shows it worked but if I click it in a second time nothing happens any suggestions? in flutter language thank you in advance

I want the clickable cards unlimited tap and to be reusable to show the details

3

Answers


  1. Chosen as BEST ANSWER

    here is my code that I tried but didn't worked

    return MouseRegion(

        cursor: SystemMouseCursors.click,
        onEnter: (_) {
          ref.read(cardColorProvider).color =
              color_constants.primary.withOpacity(0.9);
        },
        onExit: (_) {
          ref.read(cardColorProvider).color = Colors.transparent;
        },
        child: Card(
          elevation: 3,
          child: InkWell(
            onTap: () async {
              await ref.read(tabIndexProvider.notifier).setValue(5);
              if (context.mounted) {
                context.goNamed('AdminTicketScreen');
              }
            },
    

  2. please share the code you have done

    as far as i understand here is my code based on your requirement:

    return GestureDetector(
      onTap: () {
        setState(() {
          _isExpanded = !_isExpanded;
        });
      },
      child: Card(
        child: Column(
          children: [
            ListTile(
              title: Text(widget.title),
            ),
            if (_isExpanded)
              Padding(
                padding: EdgeInsets.all(16.0),
                child: Text(widget.details),
              ),
          ],
        ),
      ),
    );
    
    Login or Signup to reply.
  3. this is my provider:

    @riverpod
    
    SidebarXController adminSidebarCtrlr(
    
    AdminSidebarCtrlrRef ref,
    
    int tabIndex,
    
    ) {
    return SidebarXController(selectedIndex: tabIndex, extended: true);
    }
    
    @Riverpod(keepAlive: true)
    class TabIndex extends _$TabIndex {
    @override
     int build() {
    return 0;
    }
     setValue(int value) {
    state = value;
     }
     }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search