diff --git a/lib/main.dart b/lib/main.dart index 6953f636..edda9eeb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -28,8 +28,8 @@ class MyApp extends StatelessWidget { title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, - primaryColor: Hexcolor('#B8382C'), - buttonColor: Hexcolor('#B8382C'), + primaryColor: Color(0xff58434F), + buttonColor: Color(0xff58434F), fontFamily: 'WorkSans',), initialRoute: INIT_ROUTE, routes: routes, diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index a943a153..792e4789 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -1,6 +1,12 @@ + +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; -import 'package:hexcolor/hexcolor.dart'; + import '../../lookups/patient_lookup.dart'; import '../../models/patient_model.dart'; @@ -54,389 +60,385 @@ class _PatientSearchScreenState extends State { @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text("Search Patient"), - ), - body: SingleChildScrollView( - child: LayoutBuilder(builder: (ctx, constraints) { - var smallScreenSize = 660; - bool isSmallScreen = constraints.maxWidth <= smallScreenSize; - return Container( - padding: EdgeInsets.all(15), - width: constraints.maxWidth * 0.9, - child: Form( - key: _patientSearchForm, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Patiant Type', - style: TextStyle(fontSize: 16), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - border: - Border.all(color: Theme.of(context).primaryColor), - ), - width: double.infinity, - child: DropdownButton( - value: _selectedType, - iconSize: 24, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return PATIENT_TYPE.map((item) { - return Text(item['text'], textAlign: TextAlign.end); - }).toList(); - }, - onChanged: (String newValue) => { - setState(() { - _selectedType = newValue; - }) - }, - items: PATIENT_TYPE.map((item) { - return DropdownMenuItem( - child: Text( - '${item['text']}', - textAlign: TextAlign.end, + return AppScaffold( + appBarTitle: "SEARCH FOR PATIENT", + body: ListView( + children: [ + RoundedContainer( + child: Column( + children: [ + Icon( + Icons.search, + size: SizeConfig.imageSizeMultiplier * 15, + ), + Container( + padding: EdgeInsets.all(15), + width: SizeConfig.screenWidth * 1, + child: Form( + key: _patientSearchForm, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + RoundedContainer( + margin: 0, + showBorder: true, + raduis: 30, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedType, + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return PATIENT_TYPE.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item['text'], + fontSize: + SizeConfig.textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (String newValue) => { + setState(() { + _selectedType = newValue; + }) + }, + items: PATIENT_TYPE.map((item) { + return DropdownMenuItem( + child: Text( + '${item['text']}', + textAlign: TextAlign.end, + ), + value: item['val'], + ); + }).toList(), + ), + ), + ], + ), ), - value: item['val'], - ); - }).toList(), - ), - ), - SizedBox( - height: 10, - ), - Text( - 'First Name', - style: TextStyle(fontSize: 16), - ), - SizedBox( - height: 10, - ), - TextFormField( - decoration: InputDecoration( - hintText: 'First Name', - hintStyle: TextStyle( - fontSize: isSmallScreen - ? 14 - : constraints.maxWidth * 0.024), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Hexcolor('#CCCCCC')), ), - focusedBorder: OutlineInputBorder( - borderRadius: - BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide( - color: Theme.of(context).primaryColor), - ) - //BorderRadius.all(Radius.circular(20)); + SizedBox( + height: 10, ), - onSaved: (value) { - _patientSearchFormValues.FirstName = value; - }, - validator: (value) { - if (value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - ), - SizedBox( - height: 10, - ), - Text( - 'Middle Name', - style: TextStyle(fontSize: 16), - ), - SizedBox( - height: 10, - ), - TextFormField( - decoration: InputDecoration( - hintText: 'Middle Name', - hintStyle: TextStyle( - fontSize: isSmallScreen - ? 14 - : constraints.maxWidth * 0.024), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Hexcolor('#CCCCCC')), + TextFormField( + decoration: InputDecoration( + hintText: 'First Name', + hintStyle: TextStyle( + fontSize: SizeConfig.textMultiplier * 2), + enabledBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30)), + borderSide: + BorderSide(color: Color(0xff707070)), + ), + focusedBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30)), + borderSide: BorderSide( + color: Theme.of(context).primaryColor), + ) + //BorderRadius.all(Radius.circular(20)); + ), + onSaved: (value) { + _patientSearchFormValues.FirstName = value; + }, + validator: (value) { + if (value.isEmpty) { + return 'Please enter some text'; + } + return null; + }, ), - focusedBorder: OutlineInputBorder( - borderRadius: - BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide( - color: Theme.of(context).primaryColor), - ) - //BorderRadius.all(Radius.circular(20)); + SizedBox( + height: 10, ), - validator: (value) { - if (value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - onSaved: (value) { - _patientSearchFormValues.MiddleName = value; - }, - ), - SizedBox( - height: 10, - ), - Text( - 'Last Name', - style: TextStyle(fontSize: 16), - ), - SizedBox( - height: 10, - ), - TextFormField( - decoration: InputDecoration( - hintText: 'Last Name', - hintStyle: TextStyle( - fontSize: isSmallScreen - ? 14 - : constraints.maxWidth * 0.024), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Hexcolor('#CCCCCC')), + TextFormField( + decoration: InputDecoration( + hintText: 'Middle Name', + hintStyle: TextStyle( + fontSize: SizeConfig.textMultiplier * 2), + enabledBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30)), + borderSide: + BorderSide(color: Color(0xff707070)), + ), + focusedBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30)), + borderSide: BorderSide( + color: Theme.of(context).primaryColor), + ) + //BorderRadius.all(Radius.circular(20)); + ), + validator: (value) { + if (value.isEmpty) { + return 'Please enter some text'; + } + return null; + }, + onSaved: (value) { + _patientSearchFormValues.MiddleName = value; + }, ), - focusedBorder: OutlineInputBorder( - borderRadius: - BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide( - color: Theme.of(context).primaryColor), - ) - //BorderRadius.all(Radius.circular(20)); + SizedBox( + height: 10, ), - validator: (value) { - if (value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - onSaved: (value) { - _patientSearchFormValues.LastName = value; - }, - ), - SizedBox( - height: 10, - ), - Text( - 'Phone Number', - style: TextStyle(fontSize: 16), - ), - SizedBox( - height: 10, - ), - TextFormField( - keyboardType: TextInputType.number, - decoration: InputDecoration( - hintText: 'Phone Number', - hintStyle: TextStyle( - fontSize: isSmallScreen - ? 14 - : constraints.maxWidth * 0.024), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Hexcolor('#CCCCCC')), + TextFormField( + decoration: InputDecoration( + hintText: 'Last Name', + hintStyle: TextStyle( + fontSize: SizeConfig.textMultiplier * 2), + enabledBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30)), + borderSide: + BorderSide(color: Color(0xff707070)), + ), + focusedBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30.0)), + borderSide: BorderSide( + color: Theme.of(context).primaryColor), + ) + //BorderRadius.all(Radius.circular(20)); + ), + validator: (value) { + if (value.isEmpty) { + return 'Please enter some text'; + } + return null; + }, + onSaved: (value) { + _patientSearchFormValues.LastName = value; + }, ), - focusedBorder: OutlineInputBorder( - borderRadius: - BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide( - color: Theme.of(context).primaryColor), - ) - //BorderRadius.all(Radius.circular(20)); + SizedBox( + height: 10, ), - validator: (value) { - if (value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - onSaved: (value) { - _patientSearchFormValues.PatientMobileNumber = value; - }, - ), - SizedBox( - height: 10, - ), - // Container(child: GridView(gridDelegate: null,),) - SizedBox( - height: 10, - ), - Text( - 'Patiant ID', - style: TextStyle(fontSize: 16), - ), - SizedBox( - height: 10, - ), - TextFormField( - keyboardType: TextInputType.number, - decoration: InputDecoration( - hintText: 'Patiant ID', - hintStyle: TextStyle( - fontSize: isSmallScreen - ? 14 - : constraints.maxWidth * 0.024), - enabledBorder: OutlineInputBorder( - borderRadius: - BorderRadius.all(Radius.circular(20)), - borderSide: - BorderSide(color: Hexcolor('#CCCCCC')), - ), - focusedBorder: OutlineInputBorder( - borderRadius: - BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide( - color: Theme.of(context).primaryColor), - ) - //BorderRadius.all(Radius.circular(20)); + TextFormField( + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: 'Phone Number', + hintStyle: TextStyle( + fontSize: SizeConfig.textMultiplier * 2), + enabledBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30)), + borderSide: + BorderSide(color: Color(0xff707070)), + ), + focusedBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30.0)), + borderSide: BorderSide( + color: Theme.of(context).primaryColor), + ) + //BorderRadius.all(Radius.circular(20)); + ), + validator: (value) { + if (value.isEmpty) { + return 'Please enter some text'; + } + return null; + }, + onSaved: (value) { + _patientSearchFormValues.PatientMobileNumber = + value; + }, + ), + SizedBox( + height: 10, + ), + TextFormField( + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: 'Patiant ID', + hintStyle: TextStyle( + fontSize: SizeConfig.textMultiplier * 2), + enabledBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30)), + borderSide: + BorderSide(color: Color(0xff707070)), + ), + focusedBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30.0)), + borderSide: BorderSide( + color: Theme.of(context).primaryColor), + ) + //BorderRadius.all(Radius.circular(20)); + ), + validator: (value) { + if (value.isEmpty) { + return 'Please enter some text'; + } + return null; + }, + onSaved: (value) { + _patientSearchFormValues.PatientID = + int.parse(value); + }), + SizedBox( + height: 10, + ), + TextFormField( + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: 'Patiant File', + hintStyle: TextStyle( + fontSize: SizeConfig.textMultiplier * 2), + enabledBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30)), + borderSide: + BorderSide(color: Color(0xff707070)), + ), + focusedBorder: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(30.0)), + borderSide: BorderSide( + color: Theme.of(context).primaryColor), + ) + //BorderRadius.all(Radius.circular(20)); + ), + validator: (value) { + if (value.isEmpty) { + return 'Please enter some text'; + } + return null; + }, + onSaved: (value) { + // _patientSearchFormValues. = value; + }, + ), + (!(_selectedType == '3' || _selectedType == '5')) + ? DynamicElements(_patientSearchFormValues) + : SizedBox( + height: 0, + ), + SizedBox( + height: 10, + ), + RoundedContainer( + margin: 0, + showBorder: true, + raduis: 30, + borderColor: Color(0xff707070), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 0.9, + bottom: SizeConfig.widthMultiplier * 0.9, + right: SizeConfig.widthMultiplier * 3, + left: SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButton( + isExpanded: true, + value: _selectedLocation, + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return LOCATIONS.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item['text'], + fontSize: + SizeConfig.textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (String newValue) => { + setState(() { + _selectedLocation = newValue; + }) + }, + items: LOCATIONS.map((item) { + return DropdownMenuItem( + child: Text( + '${item['text']}', + textAlign: TextAlign.end, + ), + value: item['val'], + ); + }).toList(), + ), + ), + ], + ), ), - validator: (value) { - if (value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - onSaved: (value) { - _patientSearchFormValues.PatientID = int.parse(value); - }), - SizedBox( - height: 10, - ), - Text( - 'Patiant File', - style: TextStyle(fontSize: 16), - ), - SizedBox( - height: 10, - ), - TextFormField( - keyboardType: TextInputType.number, - decoration: InputDecoration( - hintText: 'Patiant File', - hintStyle: TextStyle( - fontSize: isSmallScreen - ? 14 - : constraints.maxWidth * 0.024), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Hexcolor('#CCCCCC')), ), - focusedBorder: OutlineInputBorder( - borderRadius: - BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide( - color: Theme.of(context).primaryColor), - ) - //BorderRadius.all(Radius.circular(20)); + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Checkbox( + value: true, + activeColor: Color(0xffFFDDD9), + onChanged: (bool newValue) {}), + AppText('Only Arrived Patient', + fontSize: SizeConfig.textMultiplier * 2), + ])), + SizedBox( + height: 10, ), - validator: (value) { - if (value.isEmpty) { - return 'Please enter some text'; - } - return null; - }, - onSaved: (value) { - // _patientSearchFormValues. = value; - }, - ), - - (!(_selectedType=='3' ||_selectedType=='5'))? DynamicElements(_patientSearchFormValues): SizedBox( - height: 0, - ), - - SizedBox( - height: 10, - ), - Text( - 'Patiant', - style: TextStyle(fontSize: 16), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - border: - Border.all(color: Theme.of(context).primaryColor), - ), - width: double.infinity, - child: DropdownButton( - value: _selectedLocation, - iconSize: 24, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return LOCATIONS.map((item) { - return Text(item['text']); - }).toList(); - }, - onChanged: (String newValue) => { - setState(() { - _selectedLocation = newValue; - }) - }, - items: LOCATIONS.map((item) { - return DropdownMenuItem( - child: Text('${item['text']}'), - value: item['val'], - ); - }).toList(), + ], ), ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - RaisedButton( - onPressed: () { - _saveForm(); - }, - textColor: Colors.white, - elevation: 0.0, - padding: const EdgeInsets.all(0.0), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: BorderSide( - width: 0.5, color: Hexcolor('#CCCCCC'))), - child: Container( - padding: const EdgeInsets.all(10.0), - height: 50, - width: 200, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Text('Search', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: isSmallScreen - ? 20 - : constraints.maxWidth * 0.020)), - Icon(Icons.search) - ], - ), - ), - ) - ], - ) - ], - ), + ) + ], + ), + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: "Search", + color: Color(0xff58434F), + onPressed: () { + print("Tapped Me"); + }, + ), + ], ), - ); - }), + ) + ], )); } } diff --git a/lib/screens/profile_screen.dart b/lib/screens/profile_screen.dart new file mode 100644 index 00000000..b346e341 --- /dev/null +++ b/lib/screens/profile_screen.dart @@ -0,0 +1,63 @@ +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/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/drawer_item_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; + +class ProfileScreen extends StatefulWidget { + ProfileScreen({Key key, this.title}) : super(key: key); + + final String title; + + @override + _ProfileScreenState createState() => _ProfileScreenState(); +} + +class _ProfileScreenState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle:'Profile', + body:ListView( + padding: EdgeInsets.zero, + children: [ + Container( + height: SizeConfig.heightMultiplier * 30, + child: DrawerHeader( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + backgroundImage: NetworkImage( + "https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png"), + backgroundColor: Colors.transparent, + ), + Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + "Dr. Chris evans", + fontWeight: FontWeight.bold, + + fontSize: SizeConfig.textMultiplier * 3, + )), + AppText("Director of medical records",) + ], + ), + ), + ), + RoundedContainer(child: ListView(children: [ + DrawerItem("Gender", Icons.person_pin, color: Colors.black, subTitle: "Male",), + DrawerItem("Clinic", Icons.build, color: Colors.black, subTitle: "Neurology Clinic",), + DrawerItem("Hospital", Icons.local_hospital, color: Colors.black, subTitle: "Al-Takkassussi",), + DrawerItem("Speciality", Icons.crop_square, color: Colors.black, subTitle: "being great",), + ],), + width: SizeConfig.screenWidth*0.70, + height: SizeConfig.screenHeight*0.40, + ), + + ] + )); + } +} \ No newline at end of file diff --git a/lib/util/extenstions.dart b/lib/util/extenstions.dart new file mode 100644 index 00000000..26e49670 --- /dev/null +++ b/lib/util/extenstions.dart @@ -0,0 +1,8 @@ +extension Extension on Object { + bool isNullOrEmpty() => this == null || this == ''; + + bool isNullEmptyOrFalse() => this == null || this == '' || !this; + + bool isNullEmptyZeroOrFalse() => + this == null || this == '' || !this || this == 0; +} diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index 0dd8c225..e181e03b 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -45,13 +45,7 @@ class _DynamicElementsState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 10, - ), - Text( - 'From', - style: TextStyle(fontSize: 16), - ), + SizedBox( height: 10, ), @@ -59,16 +53,16 @@ class _DynamicElementsState extends State { keyboardType: TextInputType.number, controller: _fromDateController, decoration: InputDecoration( - hintText: '3/11/2020', + hintText: 'From', hintStyle: TextStyle( fontSize: isSmallScreen ? 14 : constraints.maxWidth * 0.024), enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Hexcolor('#CCCCCC')), + borderRadius: BorderRadius.all(Radius.circular(30)), + borderSide: BorderSide(color: Color(0xff707070)), ), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderRadius: BorderRadius.all(Radius.circular(30.0)), borderSide: BorderSide(color: Theme.of(context).primaryColor), ) @@ -87,13 +81,7 @@ class _DynamicElementsState extends State { widget._patientSearchFormValues.From = value; }, ), - SizedBox( - height: 10, - ), - Text( - 'TO', - style: TextStyle(fontSize: 16), - ), + SizedBox( height: 10, ), @@ -101,16 +89,16 @@ class _DynamicElementsState extends State { keyboardType: TextInputType.number, controller: _toDateController, decoration: InputDecoration( - hintText: '3/11/2020', + hintText: 'TO', hintStyle: TextStyle( fontSize: isSmallScreen ? 14 : constraints.maxWidth * 0.024), enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(20)), - borderSide: BorderSide(color: Hexcolor('#CCCCCC')), + borderRadius: BorderRadius.all(Radius.circular(30)), + borderSide: BorderSide(color: Color(0xff707070)), ), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderRadius: BorderRadius.all(Radius.circular(30.0)), borderSide: BorderSide(color: Theme.of(context).primaryColor), ) @@ -129,29 +117,7 @@ class _DynamicElementsState extends State { widget._patientSearchFormValues.To = value; }, ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - border: Border.all(color: Theme.of(context).primaryColor), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Checkbox( - value: true, - activeColor: Theme.of(context).primaryColor, - onChanged: (bool newValue) {}), - Text('Only Arrived Patient', - style: TextStyle( - fontSize: isSmallScreen - ? 18 - : constraints.maxWidth * 0.018)), - ], - ), - ) + ], ); }, diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart new file mode 100644 index 00000000..49c0c92e --- /dev/null +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -0,0 +1,58 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; + +import 'app_texts_widget.dart'; + +class AppButton extends StatefulWidget { + + + final GestureTapCallback onPressed; + final String title; + final IconData icon; + final Color color; + + AppButton({@required this.onPressed, this.title, this.icon, this.color}); + + _AppButtonState createState() => _AppButtonState(); + +} + + class _AppButtonState extends State{ + @override + Widget build(BuildContext context) { + return + RawMaterialButton( + fillColor: widget.color, + splashColor: widget.color, + child: Padding( + padding: EdgeInsets.only( + top: 10, + bottom: 10, + right: SizeConfig.widthMultiplier * 15, + left: SizeConfig.widthMultiplier* 15 + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + /*Icon( + widget.icon, + color: Colors.white, + ), + SizedBox( + width: 10.0, + ),*/ + AppText( + widget.title, + color: Colors.white, + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + ), + ], + ), + ), + onPressed: widget.onPressed, + shape: const StadiumBorder(), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 0993749f..b644bd73 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -40,7 +40,7 @@ class AppScaffold extends StatelessWidget { textTheme: TextTheme( title: TextStyle( color: Colors.black, fontWeight: FontWeight.bold)), - title: Text(appBarTitle), + title: Text(appBarTitle.toUpperCase()), leading: Builder(builder: (BuildContext context) { return new GestureDetector( onTap: () { diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 835323f3..07c82d17 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../util/extenstions.dart'; + // OWNER : Ibrahim albitar // DATE : 12-04-2020 @@ -17,6 +19,7 @@ class AppText extends StatefulWidget { final double marginRight; final double marginBottom; final double marginLeft; + final bool visibility; AppText(this.data, {this.color = Colors.black, @@ -27,7 +30,8 @@ class AppText extends StatefulWidget { this.marginTop = 0, this.marginRight = 0, this.marginBottom = 0, - this.marginLeft = 0,}); + this.marginLeft = 0, + this.visibility = true}); @override _AppTextState createState() => _AppTextState(); @@ -37,20 +41,23 @@ class _AppTextState extends State { @override Widget build(BuildContext context) { - return Container( - margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only( - top: widget.marginTop, - right: widget.marginRight, - bottom: widget.marginBottom, - left: widget.marginLeft - ), - child: Text( - widget.data, - style: TextStyle( - color: widget.color, - fontWeight: widget.fontWeight, - fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2), - fontFamily: widget.fontFamily), + return Visibility( + visible: widget.visibility, + child: Container( + margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only( + top: widget.marginTop, + right: widget.marginRight, + bottom: widget.marginBottom, + left: widget.marginLeft + ), + child: Text( + widget.data, + style: TextStyle( + color: widget.color, + fontWeight: widget.fontWeight, + fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2), + fontFamily: widget.fontFamily), + ), ), ); } diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index fdf035be..a52d8812 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -2,6 +2,7 @@ import 'dart:ui'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/material.dart'; +import '../../util/extenstions.dart'; import '../shared/app_texts_widget.dart'; @@ -12,9 +13,12 @@ import '../shared/app_texts_widget.dart'; class DrawerItem extends StatefulWidget { final String title; + final String subTitle; final IconData icon; + final Color color; - DrawerItem(this.title, this.icon); + + DrawerItem(this.title, this.icon,{this.color, this.subTitle = ''}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -30,15 +34,27 @@ class _DrawerItemState extends State { children: [ Icon( widget.icon, - color: Colors.white, + color: widget.color??Colors.white, size: SizeConfig.imageSizeMultiplier * 7, ), - AppText( - widget.title, - color: Colors.white, - fontWeight: FontWeight.bold, - margin: 10, - fontSize: SizeConfig.textMultiplier * 2.5, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + widget.title, + color: widget.color??Colors.white, + fontWeight: FontWeight.bold, + margin: 5, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + AppText( + widget.subTitle, + visibility: !widget.subTitle.isNullOrEmpty(), + color: widget.color??Colors.white, + marginLeft: 5, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ], ), ], )); diff --git a/pubspec.yaml b/pubspec.yaml index 7b87b081..6dd80a4f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=2.6.0 <3.0.0" dependencies: flutter: