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: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),

@ -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),

@ -319,10 +319,25 @@ class _HomeScreenState extends State<HomeScreen> {
DashboardViewModel model, projectsProvider) {
colorIndex = 0;
List<Color> backgroundColors = List(3);
backgroundColors[0] = AppGlobal.appRedColor;
backgroundColors[1] = Colors.grey[300];
backgroundColors[2] = Color(0xFF2B353E);
List<LinearGradient> 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<Color> backgroundIconColors = List(3);
backgroundIconColors[0] = Colors.white12;
backgroundIconColors[1] = Colors.white38;
@ -336,7 +351,7 @@ class _HomeScreenState extends State<HomeScreen> {
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<HomeScreen> {
}
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<HomeScreen> {
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<HomeScreen> {
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<HomeScreen> {
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<HomeScreen> {
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<HomeScreen> {
changeColorIndex();
patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex],
gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.search_medicines,
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/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
@ -197,9 +198,9 @@ class _InPatientScreenState extends State<InPatientScreen>
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,

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

@ -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"

Loading…
Cancel
Save