✨ added your tenders screen
This commit is contained in:
@@ -1,63 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../core/constants/colors.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
import 'tab_item.dart';
|
||||
|
||||
class MainTabBar extends StatefulWidget {
|
||||
const MainTabBar({super.key, required this.controller});
|
||||
|
||||
final TabController controller;
|
||||
|
||||
@override
|
||||
State<MainTabBar> createState() => _MainTabBarState();
|
||||
}
|
||||
|
||||
class _MainTabBarState extends State<MainTabBar> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: 51.0.h(),
|
||||
margin: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.0.w(), vertical: 8.0.h()),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.grey10,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: TabBar(
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
dividerColor: Colors.transparent,
|
||||
indicator: BoxDecoration(
|
||||
color: AppColors.backgroundColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.12),
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
controller: widget.controller,
|
||||
tabs: [
|
||||
TabItem(
|
||||
title: 'New',
|
||||
isActive: widget.controller.index == 0,
|
||||
onTap: () {
|
||||
widget.controller.animateTo(0);
|
||||
},
|
||||
),
|
||||
TabItem(
|
||||
title: 'Last',
|
||||
isActive: widget.controller.index == 1,
|
||||
onTap: () {
|
||||
widget.controller.animateTo(1);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../core/constants/colors.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
|
||||
class TabItem extends StatelessWidget {
|
||||
const TabItem({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.isActive,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final bool isActive;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Tab(
|
||||
child: SizedBox(
|
||||
width: 170.0.w(),
|
||||
child: Center(
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0.sp(),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isActive ? AppColors.mainBlue : AppColors.grey60,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export 'last_tenders_tab.dart';
|
||||
export 'main_tab_bar.dart';
|
||||
export '../../shared/main_tab_bar.dart';
|
||||
export 'tender_app_bar.dart';
|
||||
export 'tender_card.dart';
|
||||
|
||||
Reference in New Issue
Block a user