v1.8.5custom_sliding_segmented_control
允許您靈活地設定顯示控制項的 widget。您可以新增顏色、速度、大小、初始值、動畫等。
228喜歡 4.7萬近 30 天下載150Pub 分數
AndroidiOSWebmacOSWindowsLinux
自定義滑動分段控制項
^1.0.1{"sdk":"flutter"}^1.1.0{"sdk":"flutter"}^2.8.0以下為英文專案原文快照,最新內容請造訪 GitHub。
Allows you to flexibly configure the widget for displaying controls. You can add color, speed, size, initial value, animation and more.
https://raw.githubusercontent.com/hadukin/custom_sliding_segmented_control/main/screenshot/screenshot_3.png
import 'package:custom_sliding_segmented_control/custom_sliding_segmented_control.dart';
CustomSlidingSegmentedControl<int>(
initialValue: 2,
children: {
1: Text('News daily portal'),
2: Text('Map'),
3: Text('Paper'),
},
decoration: BoxDecoration(
color: CupertinoColors.lightBackgroundGray,
borderRadius: BorderRadius.circular(8),
),
thumbDecoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(6),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(.3),
blurRadius: 4.0,
spreadRadius: 1.0,
offset: Offset(
0.0,
2.0,
),
),
],
),
duration: Duration(milliseconds: 300),
curve: Curves.easeInToLinear,
onValueChanged: (v) {
print(v);
},
),