From 94e92e89378e4ddbb1de7540066a163677973de4 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 16 Dec 2021 17:20:06 +0200 Subject: [PATCH] fix home --- lib/screens/home/home_page_card.dart | 5 ++--- lib/screens/home/home_patient_card.dart | 2 +- lib/screens/home/home_screen.dart | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index b65d872a..17d3426e 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -8,8 +8,7 @@ class HomePageCard extends StatelessWidget { this.imageName, required this.child, required this.onTap, - Key? key, - required this.color, + Key? key, this.color, this.opacity = 0.4, required this.margin, this.width, this.gradient}) : super(key: key); @@ -17,7 +16,7 @@ class HomePageCard extends StatelessWidget { final String? imageName; final Widget child; final GestureTapCallback onTap; - final Color color; + final Color ?color; final double opacity; final double? width; final EdgeInsets margin; diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 2ae9862f..a7d1988b 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -30,7 +30,7 @@ class HomePatientCard extends StatelessWidget { double width = SizeConfig.heightMultiplier* (SizeConfig.isHeightVeryShort ? 16 : SizeConfig.isHeightLarge?15:13); return HomePageCard( - color: backgroundColor!, + // color: backgroundColor!, width: width, gradient: gradient, margin: EdgeInsets.all(SizeConfig.widthMultiplier *1.121), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 97c88346..5452777c 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -340,32 +340,32 @@ class _HomeScreenState extends State { colorIndex = 0; List backgroundColors = []; - backgroundColors[0] = LinearGradient( + backgroundColors.add(LinearGradient( begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), colors: [ AppGlobal.appRedColor,Color(0xFFAD3B3B), - ]);//AppGlobal.appRedColor; - backgroundColors[1] = LinearGradient( + ]));//AppGlobal.appRedColor; + backgroundColors.add( LinearGradient( begin: Alignment.center, end: Alignment.center, colors: [ Color(0xFFC9C9C9),Color(0xFFC9C9C9), - ]); - backgroundColors[2] = LinearGradient( + ])); + backgroundColors.add( LinearGradient( begin: Alignment.center, end: Alignment.center, colors: [ Color(0xFF71787E),AppGlobal.appTextColor - ]); + ])); List backgroundIconColors = []; - backgroundIconColors[0] = Colors.white12; - backgroundIconColors[1] = Colors.white38; - backgroundIconColors[2] = Colors.white10; + backgroundIconColors.add(Colors.white12); + backgroundIconColors.add(Colors.white38); + backgroundIconColors.add(Colors.white10); List textColors = []; - textColors[0] = Colors.white; - textColors[1] = Color(0xFF353E47); - textColors[2] = Colors.white; + textColors.add(Colors.white); + textColors.add(Color(0xFF353E47)); + textColors.add(Colors.white); List patientCards = [];