forked from eatvio/eatvio_app
56 lines
1.6 KiB
Dart
56 lines
1.6 KiB
Dart
import 'package:eatvio_app/core/theme/custom_text_style.dart';
|
|
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
|
import 'package:eatvio_app/core/widgets/animated_option_button.dart';
|
|
import 'package:eatvio_app/generated/l10n.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
class MyRecipesTab extends StatelessWidget {
|
|
const MyRecipesTab({
|
|
super.key,
|
|
required this.selectedIndex,
|
|
required this.onTabChanged,
|
|
});
|
|
|
|
final int selectedIndex;
|
|
final ValueChanged<int> onTabChanged;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final s = S.of(context);
|
|
final tabTitles = [s.published, s.drafted];
|
|
|
|
return Align(
|
|
alignment: Alignment.centerLeft,
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
height: 48,
|
|
decoration: BoxDecoration(
|
|
color: appTheme.whiteA700,
|
|
borderRadius: BorderRadius.circular(100),
|
|
),
|
|
padding: const EdgeInsets.all(4),
|
|
child: Row(
|
|
children: [
|
|
...List.generate(
|
|
2,
|
|
(index) => Expanded(
|
|
child: AnimatedOptionButton(
|
|
textStyle: TextStyles.textSMedium,
|
|
isSelected: selectedIndex == index,
|
|
text: tabTitles[index],
|
|
onTap: () => onTabChanged(index),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|