Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShadTabs runtime error #220

Closed
jezell opened this issue Jan 4, 2025 · 1 comment · Fixed by #221
Closed

ShadTabs runtime error #220

jezell opened this issue Jan 4, 2025 · 1 comment · Fixed by #221
Assignees
Labels
accepted A valid and reproducible issue bug Something isn't working

Comments

@jezell
Copy link
Contributor

jezell commented Jan 4, 2025

Steps to reproduce

class TeamSettingsPage extends StatefulWidget {
  const TeamSettingsPage({ super.key });
  
  @override
  State createState() => _TeamSettingsPage();
}

class _TeamSettingsPage extends State<TeamSettingsPage> {

  String currentTab = "members";

  @override
  Widget build(BuildContext context) {
    return Column(
          mainAxisSize: MainAxisSize.min,
          children: [ 
            
        
              ShadTabs<String>(
                value: currentTab,
                onChanged: (value) {
                  setState(() {
                    currentTab = value;
                  });
                },
                tabs: [
                  ShadTab<String>(value: "members", child: Text("members")),
                  ShadTab<String>(value: "api-keys", child: Text("api keys"))    
              ])           
      ]);
  }
}

Expected results

Clicking tab should not throw exception

Actual results

Clicking tab throws exception because of onChange not being (dynamic value) {}.

shadcn_ui version

main branch: 374e2fc

Platform

Web

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]
@jezell jezell added bug Something isn't working triage Issues that need assessment and prioritization labels Jan 4, 2025
@nank1ro nank1ro self-assigned this Jan 4, 2025
@nank1ro nank1ro added accepted A valid and reproducible issue and removed triage Issues that need assessment and prioritization labels Jan 4, 2025
@nank1ro
Copy link
Owner

nank1ro commented Jan 4, 2025

fixed in the v0.17.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted A valid and reproducible issue bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants