If you want to add your own Segmented Control design, you need to open following file:
Project_HOME > lib > hooks_v2.dart
Look for the getCustomSegmentedControlHook() method. The necessary items are provided to you.
dataListis the list on which segmented control will build.selectionIndexis currently selected item index.onSegmentChosenis the callback to use when a segmented item is chosen. It is better to use providedonSegmentChosencallback as it is handling all the necessary things rather than your own callback.
Return the widget that you want to show. eg:
…
CustomSegmentedControlHook customSegmentedControlHook = (context, dataList, selectionIndex, onSegmentChosen) {
return null; // return null if you want to use default app MaterialSegmentedControl
};
return customSegmentedControlHook;
…