From 709d75a3109bc3a5cf72997b644cfc5d47eb5faf Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 14 Apr 2020 12:30:27 +0300 Subject: [PATCH] first step from patient list --- lib/screens/my_schedule_screen.dart | 10 +++--- lib/screens/patients/patients_screen.dart | 20 +++++++---- ...m_widget.dart => card_with_bg_widget.dart} | 36 ++++++++++++------- 3 files changed, 42 insertions(+), 24 deletions(-) rename lib/widgets/shared/{schedule_item_widget.dart => card_with_bg_widget.dart} (67%) diff --git a/lib/screens/my_schedule_screen.dart b/lib/screens/my_schedule_screen.dart index 7c9bcd66..b3ec10b8 100644 --- a/lib/screens/my_schedule_screen.dart +++ b/lib/screens/my_schedule_screen.dart @@ -1,8 +1,9 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/schedule_item_widget.dart'; import 'package:flutter/material.dart'; +import '../config/size_config.dart'; +import '../widgets/shared/app_scaffold_widget.dart'; +import '../widgets/shared/card_with_bg_widget.dart'; + class MyScheduleScreen extends StatelessWidget { List litems = [ "1", @@ -55,8 +56,7 @@ class MyScheduleScreen extends StatelessWidget { Container( child: Column( children: litems.map((item) { - return ScheduleItemWidget('ER new development ideas meeting', - '09:00 AM - 10:50 AM ', 'Cloud Solution'); + return CardWithBgWidget(line1Text: 'ER new development ideas meeting',line2Text:'09:00 AM - 10:50 AM',line3Text: 'Cloud Solution',icon: Icons.add_location, heightPercentage: 0.20, widthPercentage: 0.80,); }).toList(), ), ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index c1bb6c53..106cb6fe 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -1,12 +1,15 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/schedule_item_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../config/size_config.dart'; +import '../../widgets/shared/app_scaffold_widget.dart'; +import '../../widgets/shared/card_with_bg_widget.dart'; + class PatientsScreen extends StatelessWidget { List litems = [ "1", + "1", + "1", ]; @override Widget build(BuildContext context) { @@ -14,7 +17,6 @@ class PatientsScreen extends StatelessWidget { // pageOnly: false, appBarTitle: 'Patients', body: Stack( - children: [ ClipPath( clipper: CustomShapeClipper(), @@ -23,13 +25,19 @@ class PatientsScreen extends StatelessWidget { decoration: BoxDecoration(color: Hexcolor('#FFDDD9')))), Positioned( // key: , - top: SizeConfig.realScreenHeight * 0.10, + // top: SizeConfig.realScreenHeight * 0.10, child: Container( // decoration: BoxDecoration(color: Colors.red), // margin: EdgeInsets.symmetric(vertical: 500), child: Column( children: litems.map((item) { - return Text(''); + return CardWithBgWidget( + line1Text: 'Fahad AlSlehm - 324599', + line2Text: '12/04/2020 - 02:00 PM', + // line3Text: '', + + heightPercentage: 0.15, + widthPercentage: 0.80); }).toList(), ), ), diff --git a/lib/widgets/shared/schedule_item_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart similarity index 67% rename from lib/widgets/shared/schedule_item_widget.dart rename to lib/widgets/shared/card_with_bg_widget.dart index ad8113b3..9b4bf4ff 100644 --- a/lib/widgets/shared/schedule_item_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -2,11 +2,21 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -class ScheduleItemWidget extends StatelessWidget { - String title; - String date; - String location; - ScheduleItemWidget(this.title, this.date, this.location); + +class CardWithBgWidget extends StatelessWidget { + String line1Text; + String line2Text; + String line3Text; + IconData icon; + double heightPercentage; + double widthPercentage; + CardWithBgWidget( + {this.line1Text = '', + this.line2Text = '', + this.line3Text = '', + this.icon, + this.heightPercentage, + this.widthPercentage}); @override Widget build(BuildContext context) { @@ -14,8 +24,8 @@ class ScheduleItemWidget extends StatelessWidget { children: [ RoundedContainer( Container( - height: SizeConfig.screenHeight * 0.20, - width: SizeConfig.screenWidth * 0.80, + height: SizeConfig.screenHeight * heightPercentage, + width: SizeConfig.screenWidth * widthPercentage, ), raduis: 10, backgroundColor: Hexcolor('#58434F'), @@ -28,23 +38,23 @@ class ScheduleItemWidget extends StatelessWidget { child: RoundedContainer( Container( padding: const EdgeInsets.all(15.0), - height: SizeConfig.screenHeight * 0.20, - width: SizeConfig.screenWidth * 0.80, + height: SizeConfig.screenHeight * heightPercentage, + width: SizeConfig.screenWidth * widthPercentage, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(title, style: textStyle(2.5)), + Text(line1Text, style: textStyle(2.5)), SizedBox( height: 8, ), - Text(date, style: textStyle(2.5)), + Text(line2Text, style: textStyle(2.5)), SizedBox( height: 8, ), Row( children: [ - Icon(Icons.add_location), - Text(location, style: textStyle(2.5)) + Icon(icon), + Text(line3Text, style: textStyle(2.5)) ], ) ],