import 'dart:ui'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patients_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class SearchMedicinePatientScreen extends StatefulWidget { @override _SearchMedicinePatientScreen createState() => _SearchMedicinePatientScreen(); } class _SearchMedicinePatientScreen extends State with SingleTickerProviderStateMixin { TabController _tabController; var activeIndex = 0; @override void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); } @override void dispose() { super.dispose(); _tabController.dispose(); } @override @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).searchmedicinepatient, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( preferredSize: Size.fromHeight(65.0), child: Center( child: Container( height: 60.0, color: Colors.white, margin: EdgeInsets.only(top: 10.0), width: MediaQuery.of(context).size.width, // 0.9, // decoration: BoxDecoration( // border: Border( // bottom: BorderSide( // color: Theme.of(context).dividerColor, // width: 0.9), //width: 0.7 // ), // color: Colors.white), child: TabBar( isScrollable: true, onTap: (index) { setState(() { activeIndex = index; }); }, controller: _tabController, indicatorWeight: 0.01, indicatorSize: TabBarIndicatorSize.label, labelColor: Theme.of(context).primaryColor, indicatorColor: Colors.grey[800], // labelPadding: // EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.40, decoration: BoxDecoration( color: activeIndex == 0 ? Colors.red[700] : Colors.grey[200], borderRadius: BorderRadius.circular(5)), child: Center( child: AppText( TranslationBase.of(context).searchPatient, color: activeIndex == 0 ? Colors.white : Colors.black, fontWeight: FontWeight.bold, ), ), ), Container( width: MediaQuery.of(context).size.width * 0.40, decoration: BoxDecoration( color: activeIndex == 1 ? Colors.red[700] : Colors.grey[200], borderRadius: BorderRadius.circular(5)), child: Center( child: AppText( TranslationBase.of(context).searchMedicine, fontWeight: FontWeight.bold, color: activeIndex == 1 ? Colors.white : Colors.black, ), ), ), ], ), ), ), ), body: Column( children: [ Expanded( child: TabBarView( physics: BouncingScrollPhysics(), controller: _tabController, children: [ PatientSearchScreen(), MedicineSearchScreen() ], ), ) ], ), )); } }