A material segmented control like the one for iOS, in Material style
We all know well the Cupertino segmented widget in Flutter. But there is no similar in Material, so I decided to publish it.
You can check it out on pub: (see package on dartlang)
In your pubspec.yaml, add
dependencies:
material_segmented_control: ^0.2.0
Wherever you want to use this widget, import
import 'package:material_segmented_control/material_segmented_control.dart';
MaterialSegmentedControl(
borderRadius: 32.0,
reselectable: false,
colorSelected: Colors.blueAccent,
colorUnselected: Colors.white,
leftWidget: Icon(Icons.camera_rear, color: Colors.black),
rightWidget: Icon(Icons.camera_front, color: Colors.black),
onSelected: (direction) {
switch(direction)
{
// ...
}
});