add gradiant to home page

merge-requests/922/head
Elham Rababh 4 years ago
parent 753a72b85e
commit 6b0e790cd2

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -10,7 +11,7 @@ class HomePageCard extends StatelessWidget {
Key key, Key key,
this.color, this.color,
this.opacity = 0.4, this.opacity = 0.4,
this.margin, this.width}) this.margin, this.width, this.gradient})
: super(key: key); : super(key: key);
final bool hasBorder; final bool hasBorder;
final String imageName; final String imageName;
@ -20,6 +21,8 @@ class HomePageCard extends StatelessWidget {
final double opacity; final double opacity;
final double width; final double width;
final EdgeInsets margin; final EdgeInsets margin;
final LinearGradient gradient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(
@ -28,12 +31,13 @@ class HomePageCard extends StatelessWidget {
width: width, width: width,
margin: this.margin, margin: this.margin,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder // color: !hasBorder
? color != null // ? color != null
? color // ? color
: HexColor('#050705').withOpacity(opacity) // : HexColor('#050705').withOpacity(opacity)
: Colors.white, // : Colors.white,
borderRadius: BorderRadius.circular(17.0), gradient: gradient,
borderRadius: BorderRadius.circular(20.0),
border: hasBorder border: hasBorder
? Border.all(width: 1.0, color: const Color(0xffcccccc)) ? Border.all(width: 1.0, color: const Color(0xffcccccc))
: Border.all(width: 0.0, color: Colors.transparent), : Border.all(width: 0.0, color: Colors.transparent),

@ -12,6 +12,7 @@ class HomePatientCard extends StatelessWidget {
final Color textColor; final Color textColor;
final VoidCallback onTap; final VoidCallback onTap;
final double iconSize; final double iconSize;
final LinearGradient gradient;
HomePatientCard({ HomePatientCard({
this.backgroundColor, this.backgroundColor,
@ -21,7 +22,7 @@ class HomePatientCard extends StatelessWidget {
this.text, this.text,
this.textColor, this.textColor,
this.onTap, this.onTap,
this.iconSize = 30, this.iconSize = 30, this.gradient,
}); });
@override @override
@ -31,6 +32,7 @@ class HomePatientCard extends StatelessWidget {
return HomePageCard( return HomePageCard(
color: backgroundColor, color: backgroundColor,
width: width, width: width,
gradient: gradient,
margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121),
child: Container( child: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
@ -94,6 +96,8 @@ class HomePatientCard extends StatelessWidget {
text, text,
color: textColor, color: textColor,
textAlign: TextAlign.start, textAlign: TextAlign.start,
letterSpacing: -0.33,
fontWeight: FontWeight.w600,
fontSize: fontSize:
SizeConfig.getTextMultiplierBasedOnWidth(width: width) * SizeConfig.getTextMultiplierBasedOnWidth(width: width) *
(SizeConfig.isHeightVeryShort ? 11 : 10), (SizeConfig.isHeightVeryShort ? 11 : 10),

@ -319,10 +319,25 @@ class _HomeScreenState extends State<HomeScreen> {
DashboardViewModel model, projectsProvider) { DashboardViewModel model, projectsProvider) {
colorIndex = 0; colorIndex = 0;
List<Color> backgroundColors = List(3); List<LinearGradient> backgroundColors = List(3);
backgroundColors[0] = AppGlobal.appRedColor; backgroundColors[0] = LinearGradient(
backgroundColors[1] = Colors.grey[300]; begin: Alignment(-1.0, -2.0),
backgroundColors[2] = Color(0xFF2B353E); 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<Color> backgroundIconColors = List(3); List<Color> backgroundIconColors = List(3);
backgroundIconColors[0] = Colors.white12; backgroundIconColors[0] = Colors.white12;
backgroundIconColors[1] = Colors.white38; backgroundIconColors[1] = Colors.white38;
@ -336,7 +351,7 @@ class _HomeScreenState extends State<HomeScreen> {
if (model.hasVirtualClinic) { if (model.hasVirtualClinic) {
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.livecare, cardIcon: DoctorApp.livecare,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
@ -373,7 +388,7 @@ class _HomeScreenState extends State<HomeScreen> {
} }
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.inpatient, cardIcon: DoctorApp.inpatient,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
@ -393,7 +408,7 @@ class _HomeScreenState extends State<HomeScreen> {
changeColorIndex(); changeColorIndex();
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
//TODO Elham* match the of the icon //TODO Elham* match the of the icon
cardIcon: DoctorApp.arrival_patients, cardIcon: DoctorApp.arrival_patients,
@ -411,7 +426,7 @@ class _HomeScreenState extends State<HomeScreen> {
changeColorIndex(); changeColorIndex();
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.arrival_patients, cardIcon: DoctorApp.arrival_patients,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
@ -438,7 +453,7 @@ class _HomeScreenState extends State<HomeScreen> {
changeColorIndex(); changeColorIndex();
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.referral_1, cardIcon: DoctorApp.referral_1,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
@ -456,7 +471,7 @@ class _HomeScreenState extends State<HomeScreen> {
changeColorIndex(); changeColorIndex();
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.search, cardIcon: DoctorApp.search,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
@ -473,7 +488,7 @@ class _HomeScreenState extends State<HomeScreen> {
changeColorIndex(); changeColorIndex();
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.search_medicines, cardIcon: DoctorApp.search_medicines,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],

@ -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/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
@ -197,9 +198,9 @@ class _InPatientScreenState extends State<InPatientScreen>
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA),
borderRadius: 4, borderRadius: isActive?4:0,
borderWidth: 0), borderWidth: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

@ -75,6 +75,7 @@ class BottomNavigationItem extends StatelessWidget {
fontSize: fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() * SizeConfig.getTextMultiplierBasedOnWidth() *
2, 2,
letterSpacing: 0.24,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
fontWeight: FontWeight.w600) //#989898, fontWeight: FontWeight.w600) //#989898,
), ),

@ -706,7 +706,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -1040,7 +1040,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.1"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1245,5 +1245,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: 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" flutter: ">=1.22.2 <2.0.0"

Loading…
Cancel
Save