mirror of
https://github.com/foss42/apidash.git
synced 2025-09-21 04:22:50 +08:00
feat: Tab indicators for request params, headers, body
This commit is contained in:
39
lib/widgets/tabs.dart
Normal file
39
lib/widgets/tabs.dart
Normal file
@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:apidash/consts.dart';
|
||||
|
||||
class TabLabel extends StatelessWidget {
|
||||
const TabLabel({super.key, required this.text, this.showIndicator = false});
|
||||
final String text;
|
||||
final bool showIndicator;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: kTabHeight,
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
text,
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.fade,
|
||||
softWrap: false,
|
||||
style: kTextStyleButton,
|
||||
),
|
||||
),
|
||||
if (showIndicator)
|
||||
const Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 6),
|
||||
child: Icon(
|
||||
Icons.circle,
|
||||
size: 6,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user