Untitled
unknown
dart
3 years ago
3.2 kB
10
Indexable
import 'package:centro/app/utilities/ui/widgets/primary_appbar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../views/project_card.dart';
class ProjectTabBar extends StatelessWidget {
const ProjectTabBar({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const PrimaryAppBar(
showBackButton: true,
),
body: DefaultTabController(
length: 4, // length of tabs
initialIndex: 0,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const TabBar(
labelColor: Colors.green,
unselectedLabelColor: Colors.black,
tabs: [
Tab(text: 'Tab 1'),
Tab(text: 'Tab 2'),
Tab(text: 'Tab 3'),
Tab(text: 'Tab 4'),
],
),
Container(
height: Get.height, //height of TabBarView
decoration: const BoxDecoration(
border: Border(
top: BorderSide(color: Colors.grey, width: 0.5))),
child: TabBarView(children: <Widget>[
ListView.separated(
separatorBuilder: (context, index) => SizedBox(
height: Get.height * 0.02,
),
shrinkWrap: true,
itemCount: 10,
itemBuilder: (context, index) => ProjectCard(
projectOfficer: 'عبدالله الأحمدي',
isPending: false,
isCancel: false,
percentage: 1,
projectState: 'completed'.tr,
projectName: 'لجنة مؤتمر رؤية 2030',
projectDetails: 'تفصيل صغير عن المشروع يضاف هنا',
missionsNumber: '16 مهمة',
isCompleted: true),
),
const Center(
child: Text('Display Tab 2',
style: TextStyle(
fontSize: 22, fontWeight: FontWeight.bold)),
),
const Center(
child: Text('Display Tab 3',
style: TextStyle(
fontSize: 22, fontWeight: FontWeight.bold)),
),
const Center(
child: Text('Display Tab 4',
style: TextStyle(
fontSize: 22, fontWeight: FontWeight.bold)),
),
]))
]),
)),
);
}
}
Editor is loading...