home design

middle_screen
Elham Rababah 5 years ago
parent 3d5bb08adf
commit 259ea53319

@ -10,8 +10,7 @@ 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 'Label.dart';
import 'label.dart';
class DashboardReferralPatient extends StatelessWidget {
final List<DashboardModel> dashboardItemList;
@ -58,12 +57,40 @@ class DashboardReferralPatient extends StatelessWidget {
CrossAxisAlignment.start,
children: [
SizedBox(
height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort?3:SizeConfig.isHeightShort?2: 2)
height: SizeConfig
.getHeightMultiplier(
height: height) *
(SizeConfig.isHeightVeryShort
? 3
: SizeConfig.isHeightShort
? 2
: 2)
),
Label(firstLine:TranslationBase.of(context).patients ,secondLine:TranslationBase.of(context).referral,color: Color(0xFF2B353E), ),
Label(firstLine: TranslationBase
.of(context)
.patients,
secondLine: TranslationBase
.of(context)
.referral,
color: Color(0xFF2B353E),
fontSize: SizeConfig
.getHeightMultiplier(
height: height) *
(SizeConfig.isHeightVeryShort
? 5
: SizeConfig.isHeightShort
? 7
: 12),),
SizedBox(
height: SizeConfig.getHeightMultiplier(height: height) * (SizeConfig.isHeightVeryShort?5:SizeConfig.isHeightShort?10: 12)
height: SizeConfig
.getHeightMultiplier(
height: height) *
(SizeConfig.isHeightVeryShort
? 5
: SizeConfig.isHeightShort
? 10
: 12)
)
],
),),

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/dashboard/activity_card.dart';
import 'package:flutter/material.dart';
import 'Label.dart';
import 'label.dart';
class DashboardSliderItemWidget extends StatelessWidget {
final DashboardModel item;

@ -23,8 +23,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'Label.dart';
import 'home_screen_header.dart';
import 'label.dart';
class HomeScreen extends StatefulWidget {
HomeScreen({Key key, this.title}) : super(key: key);
@ -46,6 +46,8 @@ class _HomeScreenState extends State<HomeScreen> {
String clinicId;
AuthenticationViewModel authenticationViewModel;
int colorIndex = 0;
final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
@ -58,6 +60,7 @@ class _HomeScreenState extends State<HomeScreen> {
}
return BaseView<DashboardViewModel>(
onModelReady: (model) async {
await model.setFirebaseNotification(
projectsProvider, authenticationViewModel);
@ -70,6 +73,9 @@ class _HomeScreenState extends State<HomeScreen> {
isShowAppBar: true,
appBar: HomeScreenHeader(
model: model,
onOpenDrawer: (){
Scaffold.of(context).openDrawer();
},
),
body: ListView(children: [
Column(children: <Widget>[

@ -17,11 +17,12 @@ import 'package:provider/provider.dart';
class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget {
final DashboardViewModel model;
final Function onOpenDrawer;
double height = SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 10 : 6);
HomeScreenHeader({Key key, this.model}) : super(key: key);
HomeScreenHeader({Key key, this.model, this.onOpenDrawer}) : super(key: key);
@override
_HomeScreenHeaderState createState() => _HomeScreenHeaderState();
@ -33,7 +34,8 @@ class HomeScreenHeader extends StatefulWidget with PreferredSizeWidget {
class _HomeScreenHeaderState extends State<HomeScreenHeader> {
ProjectViewModel projectsProvider;
var clinicId;
int clinicId;
AuthenticationViewModel authenticationViewModel;
@ -53,7 +55,9 @@ class _HomeScreenHeaderState extends State<HomeScreenHeader> {
),
iconSize: SizeConfig.heightMultiplier * 2,
color: Colors.black,
onPressed: () => Scaffold.of(context).openDrawer(),
onPressed: (){
widget.onOpenDrawer();
},
),
Column(
children: <Widget>[
@ -113,9 +117,9 @@ class _HomeScreenHeaderState extends State<HomeScreenHeader> {
constraints:
BoxConstraints(
minWidth: SizeConfig
.widthMultiplier * 5.5,
.getHeightMultiplier(height: widget.height) * 50,
minHeight: SizeConfig
.widthMultiplier * 5,
.getHeightMultiplier(height: widget.height) * 50,
),
child: Center(
child: AppText(
@ -129,9 +133,9 @@ class _HomeScreenHeaderState extends State<HomeScreenHeader> {
projectsProvider
.isArabic
? SizeConfig
.widthMultiplier * 3.5
.getHeightMultiplier(height: widget.height)
: SizeConfig
.widthMultiplier * 3,
.getHeightMultiplier(height: widget.height) * 30,
textAlign:
TextAlign
.center,

@ -7,11 +7,12 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable
class Label extends StatelessWidget {
Label({
Key key, this.firstLine, this.secondLine, this.color,
Key key, this.firstLine, this.secondLine, this.color, this.fontSize,
}) : super(key: key);
final String firstLine;
final String secondLine;
Color color;
final double fontSize;
@override
Widget build(BuildContext context) {
@ -24,7 +25,7 @@ class Label extends StatelessWidget {
children: [
AppText(
firstLine,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) ,
fontSize: fontSize??SizeConfig.getTextMultiplierBasedOnWidth() *(SizeConfig.isWidthLarge?2:3) ,
// fontWeight: FontWeight.bold,
color: color,
fontHeight: .5,
@ -32,7 +33,7 @@ class Label extends StatelessWidget {
AppText(
secondLine,
color: color,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5,
fontSize: fontSize??SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?6:6.40),
fontWeight: FontWeight.bold,
),
],

@ -1,8 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/screens/home/Label.dart';
import 'package:doctor_app_flutter/screens/home/label.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
@ -13,30 +12,40 @@ class GetOutPatientStack extends StatelessWidget {
@override
Widget build(BuildContext context) {
double barHeight =
SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 23 : 19);
value.summaryoptions
.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value);
var list = new List<Widget>();
value.summaryoptions.forEach((result) =>
{list.add(getStack(result, value.summaryoptions.first.value,context))});
value.summaryoptions.forEach((result) => {
list.add(getStack(
result, value.summaryoptions.first.value, context, barHeight))
});
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 5,vertical: 5),
child: Label(firstLine:Helpers.getLabelFromKPI(value.kPIName) ,secondLine:Helpers.getNameFromKPI(value.kPIName),color: Color(0xFF2B353E), ),
padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5),
child: Label(
firstLine: Helpers.getLabelFromKPI(value.kPIName),
secondLine: Helpers.getNameFromKPI(value.kPIName),
color: Color(0xFF2B353E),
fontSize: SizeConfig.getHeightMultiplier(height: barHeight) *
(SizeConfig.isHeightVeryShort
? 5
: SizeConfig.isHeightShort
? 9
: 12),
),
),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list)
],
);
}
getStack(Summaryoptions value, max,context) {
double barHeight = SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 23 : 19);
getStack(Summaryoptions value, max, context, barHeight) {
return Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 2),

@ -21,6 +21,7 @@ class AppScaffold extends StatelessWidget {
final Widget appBar;
final String subtitle;
final bool isHomeIcon;
final Key key;
AppScaffold(
{this.appBarTitle = '',
this.body,
@ -30,7 +31,7 @@ class AppScaffold extends StatelessWidget {
this.bottomSheet,
this.backgroundColor,
this.isHomeIcon = true,
this.appBar, this.subtitle});
this.appBar, this.subtitle, this.key});
@override
Widget build(BuildContext context) {
@ -42,6 +43,7 @@ class AppScaffold extends StatelessWidget {
},
child: Scaffold(
backgroundColor: backgroundColor ?? Colors.white,
key: key,
appBar: isShowAppBar
? appBar ??
AppBar(

Loading…
Cancel
Save