From 711f39a151843d49a42d371ebc4bf47bfac20c21 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 12 Apr 2020 19:35:29 +0300 Subject: [PATCH] first step from schedule screen --- .vscode/settings.json | 2 +- lib/routes.dart | 2 +- lib/screens/my_schedule_screen.dart | 132 +++++++++++++++++++- lib/widgets/shared/app_scaffold_widget.dart | 2 +- 4 files changed, 132 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4969fedb..a1b95030 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "commentBox.styles": { "defaultStyle": { - "commentStartToken": "/* \n *@author: Elham Rababah \n *@Date:13/4/1993 \n *@param: \n *@return:\n *@desc: ", + "commentStartToken": "/* \n *@author: Elham Rababah \n *@Date:13/4/2020 \n *@param: \n *@return:\n *@desc: ", "commentEndToken": "\n */", "leftEdgeToken": " * ", "rightEdgeToken": "", diff --git a/lib/routes.dart b/lib/routes.dart index 82771ae6..71ad519a 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -12,7 +12,7 @@ import './screens/patients/patient_search_screen.dart'; import './screens/patients/patients_list_screen.dart'; import './screens/settings/settings_screen.dart'; -const String INIT_ROUTE = LOGIN; +const String INIT_ROUTE = MY_SCHEDULE; const String HOME = '/'; const String LOGIN = 'login'; const String CHANGE_PASSWORD = 'change-password'; diff --git a/lib/screens/my_schedule_screen.dart b/lib/screens/my_schedule_screen.dart index c7775c10..29393b18 100644 --- a/lib/screens/my_schedule_screen.dart +++ b/lib/screens/my_schedule_screen.dart @@ -1,9 +1,135 @@ +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/rounded_container_widget.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + class MyScheduleScreen extends StatelessWidget { + List litems = [ + "1", + "2", + ]; + @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: Text("My Schedule"),), + return AppScaffold( + // pageOnly: false, + appBarTitle: 'My Schdule', + body: Container( + decoration: new BoxDecoration( + gradient: LinearGradient( + colors: [Colors.red[100], Colors.white], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: ListView(children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text('My Schedule', style: textStyle(3, FontWeight.w700)), + scheduleListByDate('Today, 7 April '), + scheduleListByDate('Wednesday, 8 April '), + ], + ), + ], + ), + ]), + )); + } + + Column scheduleListByDate(date) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Text(date, style: textStyle(3)), + Container( + child: Column( + children: litems.map((item) { + return ScheduleItemWidget(); + }).toList(), + ), + ), + ], ); } -} \ No newline at end of file + + TextStyle textStyle(size, [FontWeight weight]) { + return TextStyle( + fontSize: size * SizeConfig.textMultiplier, fontWeight: weight); + } +} + +class ScheduleItemWidget extends StatelessWidget { + const ScheduleItemWidget({ + Key key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + RoundedContainer( + Container( + height: SizeConfig.screenHeight * 0.22, + width: SizeConfig.screenWidth * 0.95, + decoration: BoxDecoration(border: ), + // decoration: DoxD, + ), + backgroundColor: Colors.red, + showBorder: true, + borderColor: Hexcolor('#707070'), + ), + Positioned( + left: 10, + child: RoundedContainer( + Container( + padding: const EdgeInsets.all(15.0), + height: SizeConfig.screenHeight * 0.22, + width: SizeConfig.screenWidth * 0.92, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('ER new development ideas meeting ', + style: textStyle(3)), + SizedBox( + height: 8, + ), + Text('09:00 AM - 10:50 AM ', style: textStyle(3)), + SizedBox( + height: 8, + ), + Row( + children: [ + Icon(Icons.add_location), + Text('Cloud Solution ', style: textStyle(3)) + ], + ) + ], + ), + ), + elevation: 20, + raduis: 0, + showBorder: true, + borderColor: Hexcolor('#707070'), + ), + ), + ], + ); + } + + TextStyle textStyle(size, [FontWeight weight]) { + return TextStyle( + fontSize: size * SizeConfig.textMultiplier, fontWeight: weight); + } +} diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 373c94c6..218c9e84 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -15,7 +15,7 @@ class AppScaffold extends StatelessWidget { bool showAppBar = true; bool showAppDrawer = true; bool showBottomBar = true; - String appBarTitle; + String appBarTitle=''; Widget body; @override