You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doctor_app_flutter/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart

108 lines
3.9 KiB
Dart

import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class UcafDetailScreen extends StatefulWidget {
@override
_UcafDetailScreenState createState() => _UcafDetailScreenState();
}
class _UcafDetailScreenState extends State<UcafDetailScreen> {
int _activeTap = 1;
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).ucaf,
body: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
PatientHeaderWidgetNoAvatar(patient),
SizedBox(
height: 10,
),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
children: [
treatmentStepsBar(context, screenSize),
SizedBox(
height: 16,
),
],
),
),
],
),
),
),
));
}
Widget treatmentStepsBar(BuildContext _context, Size screenSize) {
List<String> __treatmentSteps = [
TranslationBase.of(context).diagnosis.toUpperCase(),
TranslationBase.of(context).medications.toUpperCase(),
TranslationBase.of(context).procedures.toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration:
Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: __treatmentSteps.map((item) {
bool _isActive = __treatmentSteps[_activeTap] == item ? true : false;
return Expanded(
child: InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: Helpers.containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
)),
),
onTap: () {
print(__treatmentSteps.indexOf(item));
setState(() {
_activeTap = __treatmentSteps.indexOf(item);
});
},
),
);
}).toList(),
),
);
}
}