{"id":21877521,"url":"https://github.com/erabossid/flutter-progressive-tabbar","last_synced_at":"2025-03-10T14:23:23.374Z","repository":{"id":166676955,"uuid":"625276595","full_name":"erabosscode/flutter-progressive-tabbar","owner":"erabosscode","description":"Complete one step then you can move another. Progressive tabbar code in flutter","archived":false,"fork":false,"pushed_at":"2023-04-08T16:01:56.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T02:22:54.116Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erabosscode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-08T16:00:15.000Z","updated_at":"2023-04-08T16:00:15.000Z","dependencies_parsed_at":"2023-06-01T15:15:28.918Z","dependency_job_id":null,"html_url":"https://github.com/erabosscode/flutter-progressive-tabbar","commit_stats":null,"previous_names":["tradecoder/flutter-progressive-tabbar","logixmaster/flutter-progressive-tabbar","mydigita/flutter-progressive-tabbar","erabossid/flutter-progressive-tabbar","erabosstt/flutter-progressive-tabbar","erabosscode/flutter-progressive-tabbar"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erabosscode%2Fflutter-progressive-tabbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erabosscode%2Fflutter-progressive-tabbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erabosscode%2Fflutter-progressive-tabbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erabosscode%2Fflutter-progressive-tabbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erabosscode","download_url":"https://codeload.github.com/erabosscode/flutter-progressive-tabbar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242865177,"owners_count":20197846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T08:09:31.132Z","updated_at":"2025-03-10T14:23:23.352Z","avatar_url":"https://github.com/erabosscode.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# flutter-progressive-tabbar\nComplete one step then you can move another. Progressive tabbar code in flutter\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:flutter/cupertino.dart';\n\nvoid main() {\n  runApp(const MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  const MyApp({Key? key}) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      debugShowCheckedModeBanner: false,\n      theme: ThemeData(\n        primarySwatch: Colors.indigo,\n      ),\n      home: const JobApplicationFlow(),\n    );\n  }\n}\n\nclass JobApplicationFlow extends StatefulWidget {\n  const JobApplicationFlow({Key? key}) : super(key: key);\n\n  @override\n  _JobApplicationFlowState createState() =\u003e _JobApplicationFlowState();\n}\n\nclass _JobApplicationFlowState extends State\u003cJobApplicationFlow\u003e\n    with SingleTickerProviderStateMixin {\n  // We need a TabController to control the selected tab programmatically\n  late final _tabController = TabController(length: 3, vsync: this);\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: const Text('Job Application'),\n        // Use TabBar to show the three tabs\n        bottom: ReadOnlyTabBar(\n          child: TabBar(\n            controller: _tabController,\n            tabs: const \u003cWidget\u003e[\n              Tab(\n                icon: Icon(Icons.radio_button_on, color: Colors.white),\n                text: 'Experience',\n              ),\n              Tab(\n                icon: Icon(Icons.check_box, color: Colors.white),\n                text: 'Skills',\n              ),\n              Tab(\n                icon: Icon(Icons.send, color: Colors.white),\n                text: 'Submit',\n              ),\n            ],\n          ),\n        ),\n      ),\n      body: TabBarView(\n        // make sure we can't switch tabs with interactive drag gestures\n        physics: const NeverScrollableScrollPhysics(),\n        controller: _tabController,\n        children: [\n          ExperiencePage(\n            onNext: () =\u003e _tabController.index = 1,\n          ),\n          SkillsPage(\n            onNext: () =\u003e _tabController.index = 2,\n          ),\n          SubmitPage(\n            onSubmit: () =\u003e showCupertinoDialog(\n              context: context,\n              builder: (_) {\n                return CupertinoAlertDialog(\n                  title: const Text('Thank you'),\n                  content: const Text('Your application was submitted.'),\n                  actions: [\n                    CupertinoDialogAction(\n                      child: const Text('OK'),\n                      onPressed: () {\n                        // dismiss dialog\n                        Navigator.of(context).pop();\n                        _tabController.index = 0;\n                      },\n                    ),\n                  ],\n                );\n              },\n            ),\n          ),\n        ],\n      ),\n    );\n  }\n}\n\n// https://stackoverflow.com/a/57354375/436422\nclass ReadOnlyTabBar extends StatelessWidget implements PreferredSizeWidget {\n  final TabBar child;\n\n  const ReadOnlyTabBar({Key? key, required this.child}) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    return IgnorePointer(child: child);\n  }\n\n  @override\n  Size get preferredSize =\u003e child.preferredSize;\n}\n\nenum Experience {\n  lessThanOneYear,\n  oneToThreeYears,\n  threeToFiveYears,\n  overFiveYears,\n}\n\nclass ExperiencePage extends StatefulWidget {\n  const ExperiencePage({Key? key, required this.onNext}) : super(key: key);\n  final VoidCallback onNext;\n\n  @override\n  State\u003cExperiencePage\u003e createState() =\u003e _ExperiencePageState();\n}\n\nclass _ExperiencePageState extends State\u003cExperiencePage\u003e {\n  Experience? _experience;\n\n  final _experienceTitles = {\n    Experience.lessThanOneYear: 'Less than one year',\n    Experience.oneToThreeYears: 'One to three years',\n    Experience.threeToFiveYears: 'Three to five years',\n    Experience.overFiveYears: 'Over five years',\n  };\n\n  @override\n  Widget build(BuildContext context) {\n    return Padding(\n      padding: const EdgeInsets.all(16.0),\n      child: Column(\n        crossAxisAlignment: CrossAxisAlignment.stretch,\n        children: [\n          const SizedBox(height: 16),\n          const Text('How many years of experience do you have?'),\n          const SizedBox(height: 16),\n          for (var item in Experience.values)\n            RadioListTile\u003cExperience\u003e(\n              title: Text(_experienceTitles[item]!),\n              value: item,\n              groupValue: _experience,\n              onChanged: (value) {\n                setState(() =\u003e _experience = value);\n              },\n            ),\n          const Spacer(),\n          PrimaryButton(\n            onPressed: _experience != null ? widget.onNext : null,\n            text: 'Next',\n          ),\n        ],\n      ),\n    );\n  }\n}\n\nenum Skill {\n  flutter,\n  dart,\n  firebase,\n  cloudFunctions,\n}\n\nclass SkillsPage extends StatefulWidget {\n  const SkillsPage({Key? key, required this.onNext}) : super(key: key);\n  final VoidCallback onNext;\n\n  @override\n  State\u003cSkillsPage\u003e createState() =\u003e _SkillsPageState();\n}\n\nclass _SkillsPageState extends State\u003cSkillsPage\u003e {\n  final Set\u003cSkill\u003e _skills = {};\n\n  final _experienceTitles = {\n    Skill.flutter: 'Flutter',\n    Skill.dart: 'Dart',\n    Skill.firebase: 'Firebase',\n    Skill.cloudFunctions: 'Cloud Functions',\n  };\n\n  @override\n  Widget build(BuildContext context) {\n    return Padding(\n      padding: const EdgeInsets.all(16.0),\n      child: Column(\n        crossAxisAlignment: CrossAxisAlignment.stretch,\n        children: [\n          const SizedBox(height: 16),\n          const Text('Which of these skills do you have?'),\n          Text(\n            'Select all that apply',\n            style: Theme.of(context).textTheme.caption,\n          ),\n          const SizedBox(height: 16),\n          for (var item in Skill.values)\n            CheckboxListTile(\n              title: Text(_experienceTitles[item]!),\n              value: _skills.contains(item),\n              onChanged: (value) {\n                setState(() {\n                  if (value == true) {\n                    _skills.add(item);\n                  } else {\n                    _skills.remove(item);\n                  }\n                });\n              },\n            ),\n          const Spacer(),\n          PrimaryButton(\n            onPressed: _skills.isNotEmpty ? widget.onNext : null,\n            text: 'Next',\n          ),\n        ],\n      ),\n    );\n  }\n}\n\nclass SubmitPage extends StatefulWidget {\n  const SubmitPage({Key? key, required this.onSubmit}) : super(key: key);\n  final VoidCallback onSubmit;\n\n  @override\n  State\u003cSubmitPage\u003e createState() =\u003e _SubmitPageState();\n}\n\nclass _SubmitPageState extends State\u003cSubmitPage\u003e {\n  final _formKey = GlobalKey\u003cFormState\u003e();\n\n  @override\n  Widget build(BuildContext context) {\n    return Padding(\n      padding: const EdgeInsets.all(16.0),\n      child: Form(\n        key: _formKey,\n        child: Column(\n          crossAxisAlignment: CrossAxisAlignment.stretch,\n          children: [\n            const SizedBox(height: 16),\n            const Text('Please enter your email to submit your application.'),\n            const SizedBox(height: 16),\n            TextFormField(\n              decoration: const InputDecoration(labelText: 'Email'),\n              autocorrect: false,\n              textInputAction: TextInputAction.next,\n              keyboardType: TextInputType.emailAddress,\n              keyboardAppearance: Brightness.light,\n              validator: (value) {\n                if (value == null || value.isEmpty) {\n                  return 'Can\\'t be empty';\n                }\n                return null;\n              },\n            ),\n            const Spacer(),\n            PrimaryButton(\n              text: 'Submit',\n              onPressed: () {\n                if (_formKey.currentState!.validate()) {\n                  widget.onSubmit();\n                }\n              },\n            ),\n          ],\n        ),\n      ),\n    );\n  }\n}\n\nclass PrimaryButton extends StatelessWidget {\n  const PrimaryButton({Key? key, required this.text, this.onPressed})\n      : super(key: key);\n  final String text;\n  final VoidCallback? onPressed;\n  @override\n  Widget build(BuildContext context) {\n    return SizedBox(\n      height: 48,\n      child: ElevatedButton(\n        onPressed: onPressed,\n        child: Text(\n          text,\n          style: Theme.of(context)\n              .textTheme\n              .headline6!\n              .copyWith(color: Colors.white),\n        ),\n      ),\n    );\n  }\n}\n\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferabossid%2Fflutter-progressive-tabbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferabossid%2Fflutter-progressive-tabbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferabossid%2Fflutter-progressive-tabbar/lists"}