mirror of
https://github.com/foss42/apidash.git
synced 2025-05-28 20:27:04 +08:00
feat: history of requests
This commit is contained in:
56
lib/widgets/tabbar_segmented.dart
Normal file
56
lib/widgets/tabbar_segmented.dart
Normal file
@ -0,0 +1,56 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:apidash/consts.dart';
|
||||
|
||||
class SegmentedTabbar extends StatelessWidget {
|
||||
const SegmentedTabbar({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.tabs,
|
||||
this.tabWidth = kSegmentedTabWidth,
|
||||
this.tabHeight = kSegmentedTabHeight,
|
||||
});
|
||||
|
||||
final TabController controller;
|
||||
final List<Widget> tabs;
|
||||
final double tabWidth;
|
||||
final double tabHeight;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Container(
|
||||
margin: kPh4,
|
||||
width: tabWidth * tabs.length,
|
||||
height: tabHeight,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: kBorderRadius20,
|
||||
border: Border.all(
|
||||
color: Theme.of(context).colorScheme.outlineVariant,
|
||||
),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: kBorderRadius20,
|
||||
child: TabBar(
|
||||
dividerColor: Colors.transparent,
|
||||
indicatorWeight: 0.0,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
unselectedLabelColor:
|
||||
Theme.of(context).colorScheme.onSurface.withOpacity(0.4),
|
||||
labelStyle: kTextStyleTab.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
),
|
||||
unselectedLabelStyle: kTextStyleTab,
|
||||
splashBorderRadius: kBorderRadius20,
|
||||
indicator: BoxDecoration(
|
||||
borderRadius: kBorderRadius20,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
controller: controller,
|
||||
tabs: tabs,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user