Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from aman-singh7/app
feat: add date
- Loading branch information
Showing
5 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Patient { | ||
String appointmentDate, clinicAddress, doctorName, patientName, patientAge; | ||
|
||
Patient({ | ||
required this.appointmentDate, | ||
required this.clinicAddress, | ||
required this.doctorName, | ||
required this.patientName, | ||
required this.patientAge, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import 'package:borderhacks_client/app_theme.dart'; | ||
import 'package:borderhacks_client/models/patient_model.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
|
||
class AppointmentTile extends StatelessWidget { | ||
final Patient patient; | ||
|
||
const AppointmentTile(this.patient, {Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Card( | ||
color: AppTheme.white, | ||
child: Padding( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: 8.w, | ||
vertical: 8.h, | ||
), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
children: [ | ||
Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Text( | ||
patient.patientName, | ||
style: AppTheme.h3.copyWith( | ||
fontFamily: 'Roboto', | ||
fontWeight: FontWeight.w500, | ||
color: AppTheme.darkerBlue, | ||
), | ||
), | ||
Text( | ||
patient.patientAge, | ||
style: AppTheme.h3.copyWith( | ||
fontFamily: 'Roboto', | ||
fontWeight: FontWeight.w500, | ||
color: AppTheme.darkerBlue, | ||
), | ||
), | ||
Text( | ||
patient.appointmentDate, | ||
style: AppTheme.h3.copyWith( | ||
fontFamily: 'Roboto', | ||
fontWeight: FontWeight.w500, | ||
color: AppTheme.darkerBlue, | ||
), | ||
), | ||
], | ||
), | ||
Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Text( | ||
patient.doctorName, | ||
style: AppTheme.h3.copyWith( | ||
fontFamily: 'Roboto', | ||
fontWeight: FontWeight.w500, | ||
color: AppTheme.darkerBlue, | ||
), | ||
), | ||
Text( | ||
patient.clinicAddress, | ||
style: AppTheme.h3.copyWith( | ||
fontFamily: 'Roboto', | ||
fontWeight: FontWeight.w500, | ||
color: AppTheme.darkerBlue, | ||
), | ||
), | ||
], | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,41 @@ | ||
import 'base_view.dart'; | ||
import 'package:borderhacks_client/ui/components/appointments_tile.dart'; | ||
import 'package:borderhacks_client/viewmodels/myappointment_viewmodel.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
|
||
class MyAppointmentView extends StatelessWidget { | ||
class MyAppointmentView extends StatefulWidget { | ||
const MyAppointmentView({Key? key}) : super(key: key); | ||
|
||
@override | ||
_MyAppointmentViewState createState() => _MyAppointmentViewState(); | ||
} | ||
|
||
class _MyAppointmentViewState extends State<MyAppointmentView> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container(); | ||
return BaseView<MyAppointmentViewModel>(builder: (context, model, child) { | ||
return Scaffold( | ||
body: _buildBody(model), | ||
); | ||
}); | ||
} | ||
|
||
Widget _buildBody(MyAppointmentViewModel model) { | ||
return Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 8.h), | ||
child: Column( | ||
children: [ | ||
ListView( | ||
shrinkWrap: true, | ||
padding: EdgeInsets.symmetric(vertical: 8.h), | ||
children: List<Widget>.generate( | ||
2, | ||
(_) => AppointmentTile(model.getDummyData()), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:borderhacks_client/models/patient_model.dart'; | ||
import 'package:borderhacks_client/viewmodels/base_viewmodel.dart'; | ||
|
||
class MyAppointmentViewModel extends BaseViewModel { | ||
Patient getDummyData() { | ||
return Patient( | ||
appointmentDate: '29/09/2021', | ||
clinicAddress: '25/30 Awas Vikas', | ||
doctorName: 'Dr Vinay Singh', | ||
patientName: 'DelunRex', | ||
patientAge: '19', | ||
); | ||
} | ||
} |