From 6b0e790cd29d0d48fa4a1b1f4ee50f9da690cfa1 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 8 Dec 2021 15:09:24 +0200 Subject: [PATCH] add gradiant to home page --- lib/screens/home/home_page_card.dart | 18 +++++---- lib/screens/home/home_patient_card.dart | 6 ++- lib/screens/home/home_screen.dart | 37 +++++++++++++------ .../In_patient/in_patient_screen.dart | 7 ++-- .../shared/bottom_navigation_item.dart | 1 + pubspec.lock | 6 +-- 6 files changed, 50 insertions(+), 25 deletions(-) diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index df4ae48f..7a0d5167 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -10,7 +11,7 @@ class HomePageCard extends StatelessWidget { Key key, this.color, this.opacity = 0.4, - this.margin, this.width}) + this.margin, this.width, this.gradient}) : super(key: key); final bool hasBorder; final String imageName; @@ -20,6 +21,8 @@ class HomePageCard extends StatelessWidget { final double opacity; final double width; final EdgeInsets margin; + final LinearGradient gradient; + @override Widget build(BuildContext context) { return InkWell( @@ -28,12 +31,13 @@ class HomePageCard extends StatelessWidget { width: width, margin: this.margin, decoration: BoxDecoration( - color: !hasBorder - ? color != null - ? color - : HexColor('#050705').withOpacity(opacity) - : Colors.white, - borderRadius: BorderRadius.circular(17.0), + // color: !hasBorder + // ? color != null + // ? color + // : HexColor('#050705').withOpacity(opacity) + // : Colors.white, + gradient: gradient, + borderRadius: BorderRadius.circular(20.0), border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 06ef380f..0180fc14 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -12,6 +12,7 @@ class HomePatientCard extends StatelessWidget { final Color textColor; final VoidCallback onTap; final double iconSize; + final LinearGradient gradient; HomePatientCard({ this.backgroundColor, @@ -21,7 +22,7 @@ class HomePatientCard extends StatelessWidget { this.text, this.textColor, this.onTap, - this.iconSize = 30, + this.iconSize = 30, this.gradient, }); @override @@ -31,6 +32,7 @@ class HomePatientCard extends StatelessWidget { return HomePageCard( color: backgroundColor, width: width, + gradient: gradient, margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), child: Container( padding: EdgeInsets.all(8), @@ -94,6 +96,8 @@ class HomePatientCard extends StatelessWidget { text, color: textColor, textAlign: TextAlign.start, + letterSpacing: -0.33, + fontWeight: FontWeight.w600, fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightVeryShort ? 11 : 10), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index f5b62368..1014566f 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -319,10 +319,25 @@ class _HomeScreenState extends State { DashboardViewModel model, projectsProvider) { colorIndex = 0; - List backgroundColors = List(3); - backgroundColors[0] = AppGlobal.appRedColor; - backgroundColors[1] = Colors.grey[300]; - backgroundColors[2] = Color(0xFF2B353E); + List backgroundColors = List(3); + backgroundColors[0] = LinearGradient( + begin: Alignment(-1.0, -2.0), + end: Alignment(1.0, 2.0), + colors: [ + AppGlobal.appRedColor,Color(0xFFAD3B3B), + ]);//AppGlobal.appRedColor; + backgroundColors[1] = LinearGradient( + begin: Alignment(-1.0, -2.0), + end: Alignment(1.0, 2.0), + colors: [ + Color(0xFFC9C9C9),Color(0xFFEDEDED) + ]); + backgroundColors[2] = LinearGradient( + begin: Alignment.center, + end: Alignment.center, + colors: [ + Color(0xFF71787E),AppGlobal.appTextColor + ]); List backgroundIconColors = List(3); backgroundIconColors[0] = Colors.white12; backgroundIconColors[1] = Colors.white38; @@ -336,7 +351,7 @@ class _HomeScreenState extends State { if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.livecare, textColor: textColors[colorIndex], @@ -373,7 +388,7 @@ class _HomeScreenState extends State { } patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.inpatient, textColor: textColors[colorIndex], @@ -393,7 +408,7 @@ class _HomeScreenState extends State { changeColorIndex(); patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], //TODO Elham* match the of the icon cardIcon: DoctorApp.arrival_patients, @@ -411,7 +426,7 @@ class _HomeScreenState extends State { changeColorIndex(); patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], @@ -438,7 +453,7 @@ class _HomeScreenState extends State { changeColorIndex(); patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.referral_1, textColor: textColors[colorIndex], @@ -456,7 +471,7 @@ class _HomeScreenState extends State { changeColorIndex(); patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search, textColor: textColors[colorIndex], @@ -473,7 +488,7 @@ class _HomeScreenState extends State { changeColorIndex(); patientCards.add(HomePatientCard( - backgroundColor: backgroundColors[colorIndex], + gradient: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], cardIcon: DoctorApp.search_medicines, textColor: textColors[colorIndex], diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index ef9f8b03..a8900213 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; @@ -197,9 +198,9 @@ class _InPatientScreenState extends State child: Container( height: screenSize.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( - isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), - isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, + isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), + isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), + borderRadius: isActive?4:0, borderWidth: 0), child: Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 7956eb1d..37aff38f 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -75,6 +75,7 @@ class BottomNavigationItem extends StatelessWidget { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2, + letterSpacing: 0.24, color: AppGlobal.appTextColor, fontWeight: FontWeight.w600) //#989898, ), diff --git a/pubspec.lock b/pubspec.lock index 6fcaaa5a..86ae6905 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -706,7 +706,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -1040,7 +1040,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1245,5 +1245,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <=2.11.0-213.1.beta" + dart: ">=2.10.2 <2.11.0" flutter: ">=1.22.2 <2.0.0"