dashboard and patient app

merge-requests/91/head
Salman Afzal 6 years ago
parent bde30d93ec
commit ac612f0eda

@ -32,303 +32,354 @@ class DashboardScreen extends StatefulWidget {
} }
class _DashboardScreenState extends State<DashboardScreen> { class _DashboardScreenState extends State<DashboardScreen> {
HospitalProvider projectsProvider; HospitalProvider projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).dashboardScreenToolbarTitle, appBarTitle: TranslationBase.of(context).dashboardScreenToolbarTitle,
current: 0, current: 0,
body: Container( body: Container(
child: Column( child: new SingleChildScrollView(
children: <Widget>[ child: SizedBox(
Expanded( height: MediaQuery.of(context).size.height,
flex: 1, child: Column(
child: Container( children: <Widget>[
margin: EdgeInsets.all(10), Expanded(
child: AppText( flex: 1,
"Today's Statistics", child: Container(
fontWeight: FontWeight.bold, margin: EdgeInsets.all(10),
), child: AppText(
alignment: Alignment.centerLeft, "Today's Statistics",
), fontWeight: FontWeight.bold,
),
Expanded(
flex: 3,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: RoundedContainer(
child: CircularPercentIndicator(
radius: 90.0,
animation: true,
animationDuration: 1200,
lineWidth: 7.0,
percent: .75,
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AppText("38",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 4),
AppText("Out-Patients",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.5,
color: Colors.grey[800]),
],
),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: Colors.blueGrey[100],
progressColor: Colors.red,
),
), ),
alignment: Alignment.centerLeft,
), ),
Expanded( ),
flex: 2, Expanded(
child: Row( flex: 3,
children: <Widget>[ child: Row(
Expanded( crossAxisAlignment: CrossAxisAlignment.stretch,
flex: 1, children: <Widget>[
child: Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.stretch, flex: 2,
children: <Widget>[ child: RoundedContainer(
Expanded( child: CircularPercentIndicator(
child: DashboardItemTexts( radius: 115.0,
"Arrived", animation: true,
"23", animationDuration: 1200,
)), lineWidth: 7.0,
Expanded( percent: .75,
child: DashboardItemTexts( center: Column(
"Not Arrived", mainAxisAlignment: MainAxisAlignment.center,
"23", children: <Widget>[
), AppText("38",
), fontWeight: FontWeight.bold,
], fontSize: SizeConfig.textMultiplier * 4),
AppText("Out-Patients",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.2,
color: Colors.grey[800]),
],
),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: Colors.blueGrey[100],
progressColor: Colors.red,
), ),
), ),
Expanded( ),
child: Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.stretch, flex: 2,
children: <Widget>[ child: Padding(
Expanded( padding: EdgeInsets.all(8),
child: DashboardItemTexts( child: Row(
"ER", crossAxisAlignment: CrossAxisAlignment.start,
"23", children: <Widget>[
)), Expanded(
Expanded( flex: 1,
child: DashboardItemTexts( child: Column(
"Walk-in", crossAxisAlignment:
"23", CrossAxisAlignment.stretch,
)), children: <Widget>[
], Expanded(
)), child: DashboardItemTexts(
], "Arrived",
), "23",
) )),
], Expanded(
), child: DashboardItemTexts(
), "Not Arrived",
Expanded( "23",
flex: 2, ),
child: Row( ),
crossAxisAlignment: CrossAxisAlignment.stretch, ],
children: <Widget>[ ),
Expanded( ),
flex: 2, Expanded(
child: new DashboardItemIconText( child: Column(
DoctorApp.home_icon, crossAxisAlignment:
"08", CrossAxisAlignment.stretch,
"Lab Result", children: <Widget>[
backgroundColor: Colors.red, Expanded(
), child: DashboardItemTexts(
), "ER",
Expanded( "23",
flex: 2, )),
child: new DashboardItemIconText( Expanded(
DoctorApp.home_icon, child: DashboardItemTexts(
"10", "Walk-in",
"Radiology", "23",
backgroundColor: Colors.red, )),
)), ],
Expanded( )),
flex: 2, ],
child: new DashboardItemIconText( ),
DoctorApp.home_icon, ))
"05", ],
"Referral",
backgroundColor: Colors.red,
)),
],
),
),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"23",
"In-Patient",
showBorder: true,
),
), ),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"23",
"Operations",
showBorder: true,
)),
],
),
),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.all(10),
child: AppText(
"Patient Services",
fontWeight: FontWeight.bold,
), ),
alignment: Alignment.centerLeft, Expanded(
), flex: 2,
), child: Row(
Expanded( crossAxisAlignment: CrossAxisAlignment.stretch,
flex: 2, children: <Widget>[
child: Row( Expanded(
crossAxisAlignment: CrossAxisAlignment.stretch, flex: 2,
children: <Widget>[ child: new DashboardItemIconText(
Expanded( DoctorApp.home_icon,
flex: 2, "08",
child: InkWell( "Lab Result",
child: DashboardItemIconText( backgroundColor: Colors.black45,
DoctorApp.home_icon, // valueFontColor: Colors.white,
"", // titleFontColor: Colors.white,
"Search Patient", // iconColor: Colors.white,
showBorder: false, ),
backgroundColor: Colors.green[200],
), ),
onTap: () { Expanded(
Navigator.of(context).pushNamed(PATIENT_SEARCH); flex: 2,
}, child: new DashboardItemIconText(
), DoctorApp.home_icon,
"10",
"Radiology",
backgroundColor: Colors.black45,
// valueFontColor: Colors.white,
// titleFontColor: Colors.white,
// iconColor: Colors.white,
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"05",
"Referral",
backgroundColor: Colors.black45,
// valueFontColor: Colors.white,
// titleFontColor: Colors.white,
// iconColor: Colors.white,
)),
],
), ),
Expanded( ),
flex: 2, Expanded(
child: InkWell( flex: 2,
onTap: () { child: Row(
Navigator.push( crossAxisAlignment: CrossAxisAlignment.stretch,
context, children: <Widget>[
MaterialPageRoute( Expanded(
builder: (context) => ChangeNotifierProvider( flex: 2,
create: (_) => DoctorReplyProvider(), child: new DashboardItemIconText(
child: DoctorReplyScreen(), DoctorApp.home_icon,
), "23",
), "In-Patient",
); showBorder: true,
}, backgroundColor: Colors.red[900],
child: DashboardItemIconText( ),
DoctorApp.home_icon,
"",
"Doctor Reply",
showBorder: false,
backgroundColor: Colors.deepPurple[300],
), ),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"23",
"Operations",
showBorder: true,
backgroundColor: Colors.red[900],
)),
],
),
),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.all(10),
child: AppText(
"Patient Services",
fontWeight: FontWeight.bold,
), ),
alignment: Alignment.centerLeft,
), ),
], ),
), Expanded(
), flex: 2,
Expanded( child: Row(
flex: 3, crossAxisAlignment: CrossAxisAlignment.stretch,
child: Row( children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.stretch, Expanded(
children: <Widget>[ flex: 2,
Expanded( child: InkWell(
flex: 1, child: DashboardItemIconText(
child: InkWell( DoctorApp.home_icon,
child: DashboardItemIconText( "",
DoctorApp.home_icon, "Search Patient",
"", showBorder: true,
"Search Medicine", backgroundColor: Colors.white,
showBorder: false, valueFontColor: Colors.black,
backgroundColor: Colors.teal, titleFontColor: Colors.black,
iconColor: Colors.black,
titleFontSize: 16,
),
onTap: () {
Navigator.of(context).pushNamed(PATIENT_SEARCH);
},
),
), ),
onTap: () { Expanded(
Navigator.push( flex: 2,
context, child: InkWell(
MaterialPageRoute( onTap: () {
builder: (context) => ChangeNotifierProvider( Navigator.push(
create: (_) => MedicineProvider(), context,
child: MedicineSearchScreen(), MaterialPageRoute(
), builder: (context) => ChangeNotifierProvider(
create: (_) => DoctorReplyProvider(),
child: DoctorReplyScreen(),
),
),
);
},
child: DashboardItemIconText(
DoctorApp.home_icon,
"",
"Doctor Reply",
showBorder: true,
backgroundColor: Colors.white,
valueFontColor: Colors.black,
titleFontColor: Colors.black,
iconColor: Colors.black,
titleFontSize: 16,
), ),
); ),
}, ),
), ],
), ),
Expanded( ),
flex: 1, Expanded(
child: InkWell( flex: 2,
onTap: (){ child: Row(
Navigator.push( crossAxisAlignment: CrossAxisAlignment.stretch,
context, children: <Widget>[
MaterialPageRoute( Expanded(
builder: (context) => ChangeNotifierProvider( flex: 1,
create: (_) => MyReferralPatientProvider(), child: InkWell(
child: MyReferralPatient(), child: DashboardItemIconText(
), DoctorApp.home_icon,
"",
"Search Medicine",
showBorder: true,
backgroundColor: Colors.white,
valueFontColor: Colors.black,
titleFontColor: Colors.black,
iconColor: Colors.black,
titleFontSize: 16,
), ),
); onTap: () {
}, Navigator.push(
child: DashboardItemIconText( context,
DoctorApp.home_icon, MaterialPageRoute(
"", builder: (context) => ChangeNotifierProvider(
"My Referral Patient", create: (_) => MedicineProvider(),
showBorder: false, child: MedicineSearchScreen(),
backgroundColor: Colors.brown[400], ),
),
);
},
),
), ),
), Expanded(
), flex: 1,
child: InkWell(
//================== onTap: () {
Expanded( Navigator.push(
flex: 1, context,
child: InkWell( MaterialPageRoute(
onTap: (){ builder: (context) => ChangeNotifierProvider(
Navigator.push( create: (_) => MyReferralPatientProvider(),
context, child: MyReferralPatient(),
MaterialPageRoute( ),
builder: (context) => ChangeNotifierProvider( ),
create: (_) => MyReferredPatientProvider(), );
child: MyReferredPatient(), },
), child: DashboardItemIconText(
DoctorApp.home_icon,
"",
"My Referral Patient",
showBorder: true,
backgroundColor: Colors.white,
valueFontColor: Colors.black,
titleFontColor: Colors.black,
iconColor: Colors.black,
titleFontSize: 16,
), ),
); ),
},
child: DashboardItemIconText(
DoctorApp.home_icon,
"",
"My Referred Patient",
showBorder: false,
backgroundColor: Colors.orange,
), ),
), ],
), ),
//================== ),
], Expanded(
), flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChangeNotifierProvider(
create: (_) => MyReferredPatientProvider(),
child: MyReferredPatient(),
),
),
);
},
child: DashboardItemIconText(
DoctorApp.home_icon,
"",
"My Referred Patient",
showBorder: true,
backgroundColor: Colors.white,
valueFontColor: Colors.black,
titleFontColor: Colors.black,
iconColor: Colors.black,
titleFontSize: 16,
),
),
),
Expanded(flex: 1, child: Container())
],
)),
],
), ),
], //)
),
), // ,
); //constraints: new BoxConstraints(),
),
)));
// Container(
// );
} }
} }

@ -59,13 +59,11 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
void _validateInputs() async { void _validateInputs() async {
//print("============== _selectedType============"+ _selectedType); //print("============== _selectedType============"+ _selectedType);
try {
//====================
//_selectedType=='3'?
//=====================
try {
//====================
//_selectedType=='3'?
//=====================
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel doctorProfile =
@ -73,22 +71,22 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
_formKey.currentState.save(); _formKey.currentState.save();
sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType);
print('************_selectedType*************'); print('************_selectedType*************');
print('_selectedType${_selectedType}'); print('_selectedType${_selectedType}');
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
_patientSearchFormValues.TokenID = token; _patientSearchFormValues.TokenID = token;
_patientSearchFormValues.ProjectID = doctorProfile.projectID ;//15 _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15
_patientSearchFormValues.DoctorID = doctorProfile.doctorID; _patientSearchFormValues.DoctorID = doctorProfile.doctorID;
_patientSearchFormValues.ClinicID = doctorProfile.clinicID; _patientSearchFormValues.ClinicID = doctorProfile.clinicID;
//===================== //=====================
// _patientSearchFormValues. // _patientSearchFormValues.
//===================== //=====================
print("=============doctorProfile.clinicID="+doctorProfile.clinicID.toString()); print("=============doctorProfile.clinicID=" +
doctorProfile.clinicID.toString());
Navigator.of(context).pushNamed(PATIENTS, arguments: { Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues, "patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType "selectedType": _selectedType
@ -101,7 +99,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
} }
} }
handelCatchErrorCase(err) { handelCatchErrorCase(err) {
@ -154,7 +151,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownButton( child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true, isExpanded: true,
value: _selectedType, value: _selectedType,
iconSize: 40, iconSize: 40,
@ -178,7 +176,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
onChanged: (String newValue) => { onChanged: (String newValue) => {
setState(() { setState(() {
_selectedType = newValue; _selectedType = newValue;
selectedPatientType = int.parse(_selectedType); selectedPatientType =
int.parse(_selectedType);
}) })
}, },
items: PATIENT_TYPE.map((item) { items: PATIENT_TYPE.map((item) {
@ -190,7 +189,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
value: item['val'], value: item['val'],
); );
}).toList(), }).toList(),
), )),
), ),
], ],
), ),
@ -249,7 +248,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
_patientSearchFormValues.setLastName = "0"; _patientSearchFormValues.setLastName = "0";
} }
}, },
inputFormatter: ONLY_LETTERS), inputFormatter: ONLY_LETTERS),
SizedBox( SizedBox(
height: 10, height: 10,
@ -332,7 +330,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownButton( child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true, isExpanded: true,
value: _selectedLocation, value: _selectedLocation,
iconSize: 40, iconSize: 40,
@ -367,7 +366,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
value: item['val'], value: item['val'],
); );
}).toList(), }).toList(),
), )),
), ),
], ],
), ),

@ -1,48 +1,79 @@
import 'dart:ffi';
import '../shared/rounded_container_widget.dart'; import '../shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../shared/app_texts_widget.dart'; import '../shared/app_texts_widget.dart';
class DashboardItemIconText extends StatefulWidget { class DashboardItemIconText extends StatefulWidget {
final IconData icon;
final IconData icon; final String value;
final String value; final String label;
final String label; final Color backgroundColor;
final Color backgroundColor; final bool showBorder;
final bool showBorder; final Color borderColor;
final Color borderColor; final double titleFontSize;
final Color titleFontColor;
final Color valueFontColor;
final double valueFontSize;
final Color iconColor;
// OWNER : Ibrahim albitar // OWNER : Ibrahim albitar
// DATE : 05-04-2020 // DATE : 05-04-2020
// DESCRIPTION : Custom widget for dashboard items has texts and icons widgets // DESCRIPTION : Custom widget for dashboard items has texts and icons widgets
DashboardItemIconText(this.icon, this.value, this.label, {this.backgroundColor = Colors.white, this.showBorder = false, this.borderColor = Colors.white}); DashboardItemIconText(this.icon, this.value, this.label,
{this.backgroundColor = Colors.white,
this.showBorder = false,
this.titleFontSize = 12,
this.valueFontSize = 26,
this.valueFontColor = Colors.white,
this.titleFontColor = Colors.white,
this.iconColor = Colors.white,
this.borderColor = Colors.white});
@override @override
_DashboardItemTextsState createState() => _DashboardItemTextsState(); _DashboardItemTextsState createState() => _DashboardItemTextsState();
} }
class _DashboardItemTextsState extends State<DashboardItemIconText> { class _DashboardItemTextsState extends State<DashboardItemIconText> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new RoundedContainer( return new RoundedContainer(
child:Stack( margin: 10,
children: <Widget>[ child: Stack(
Align( children: <Widget>[
alignment: FractionalOffset.topLeft, Align(
child: Container(margin: EdgeInsets.all(10), child: Icon(widget.icon,),) alignment: FractionalOffset.topLeft,
), child: Container(
Align( margin: EdgeInsets.all(10),
alignment: FractionalOffset.bottomRight, child: Icon(
child: Container(margin: EdgeInsets.all(10), child: Column( widget.icon,
mainAxisAlignment: MainAxisAlignment.end, color: widget.iconColor,
crossAxisAlignment: CrossAxisAlignment.end, ),
children: <Widget>[ )),
AppText(widget.value,), Align(
Text(widget.label), alignment: FractionalOffset.bottomRight,
child: Container(
],)) margin: EdgeInsets.all(10),
), child: Column(
], mainAxisAlignment: MainAxisAlignment.end,
) ,backgroundColor: widget.backgroundColor, crossAxisAlignment: CrossAxisAlignment.end,
showBorder: widget.showBorder, borderColor: widget.borderColor,); children: <Widget>[
AppText(
widget.value,
color: widget.valueFontColor,
fontSize: widget.valueFontSize,
),
AppText(
widget.label,
color: widget.titleFontColor,
fontSize: widget.titleFontSize,
),
],
))),
],
),
backgroundColor: widget.backgroundColor,
showBorder: widget.showBorder,
borderColor: widget.borderColor,
);
} }
} }

@ -1,41 +1,56 @@
import '../shared/rounded_container_widget.dart'; import '../shared/rounded_container_widget.dart';
import '../shared/app_texts_widget.dart'; import '../shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DashboardItemTexts extends StatefulWidget { class DashboardItemTexts extends StatefulWidget {
final String label;
final String label; final String value;
final String value; final Color backgroundColor;
final Color backgroundColor; final bool showBorder;
final bool showBorder; final Color borderColor;
final Color borderColor;
// OWNER : Ibrahim albitar // OWNER : Ibrahim albitar
// DATE : 05-04-2020 // DATE : 05-04-2020
// DESCRIPTION : Custom widget for dashboard items has texts widgets // DESCRIPTION : Custom widget for dashboard items has texts widgets
DashboardItemTexts(this.label, this.value, {this.backgroundColor = Colors.white, this.showBorder = false, this.borderColor = Colors.white}); DashboardItemTexts(this.label, this.value,
{this.backgroundColor = Colors.white,
this.showBorder = false,
this.borderColor = Colors.white});
@override @override
_DashboardItemTextsState createState() => _DashboardItemTextsState(); _DashboardItemTextsState createState() => _DashboardItemTextsState();
} }
class _DashboardItemTextsState extends State<DashboardItemTexts> { class _DashboardItemTextsState extends State<DashboardItemTexts> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new RoundedContainer( return new RoundedContainer(
child:Stack( child: Stack(
children: <Widget>[ children: <Widget>[
Align( Align(
alignment: FractionalOffset.topLeft, alignment: FractionalOffset.topLeft,
child:Container(margin: EdgeInsets.all(5), child: AppText(widget.label),) child: Container(
), margin: EdgeInsets.all(5),
child: AppText(
Align( widget.label,
alignment: FractionalOffset.bottomRight, fontSize: 12,
child: Container(margin: EdgeInsets.all(10), child: AppText(widget.value, fontWeight: FontWeight.bold),) ),
), )),
Align(
],) ,backgroundColor: widget.backgroundColor, showBorder: widget.showBorder, borderColor: widget.borderColor, margin: 4,); alignment: FractionalOffset.bottomRight,
child: Container(
margin: EdgeInsets.all(10),
child: AppText(
widget.value,
fontWeight: FontWeight.bold,
),
)),
],
),
backgroundColor: widget.backgroundColor,
showBorder: widget.showBorder,
borderColor: widget.borderColor,
margin: 4,
);
} }
} }

@ -22,22 +22,21 @@ class RoundedContainer extends StatefulWidget {
final double borderWidth; final double borderWidth;
RoundedContainer( RoundedContainer(
{@required this.child, {@required this.child,
this.width, this.width,
this.height, this.height,
this.raduis = 10, this.raduis = 10,
this.backgroundColor = Colors.white, this.backgroundColor = Colors.white,
this.margin = 10, this.margin = 10,
this.elevation = 1, this.elevation = 1,
this.showBorder = false, this.showBorder = false,
this.borderColor = Colors.red, this.borderColor = Colors.red,
this.customCornerRaduis = false, this.customCornerRaduis = false,
this.topLeft = 0, this.topLeft = 0,
this.topRight = 0, this.topRight = 0,
this.bottomRight = 0, this.bottomRight = 0,
this.bottomLeft = 0, this.bottomLeft = 0,
this.borderWidth =1 this.borderWidth = 1});
});
@override @override
_RoundedContainerState createState() => _RoundedContainerState(); _RoundedContainerState createState() => _RoundedContainerState();
@ -47,13 +46,14 @@ class _RoundedContainerState extends State<RoundedContainer> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: widget.width, width: widget.width,
height: widget.height, height: widget.height,
margin: EdgeInsets.all(widget.margin), margin: EdgeInsets.all(widget.margin),
decoration: widget.showBorder == true decoration: widget.showBorder == true
? BoxDecoration( ? BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
border: Border.all(color: widget.borderColor, width: widget.borderWidth), border: Border.all(
color: widget.borderColor, width: widget.borderWidth),
borderRadius: widget.customCornerRaduis borderRadius: widget.customCornerRaduis
? BorderRadius.only( ? BorderRadius.only(
topLeft: Radius.circular(widget.topLeft), topLeft: Radius.circular(widget.topLeft),
@ -61,18 +61,25 @@ class _RoundedContainerState extends State<RoundedContainer> {
bottomRight: Radius.circular(widget.bottomRight), bottomRight: Radius.circular(widget.bottomRight),
bottomLeft: Radius.circular(widget.bottomLeft)) bottomLeft: Radius.circular(widget.bottomLeft))
: BorderRadius.circular(widget.raduis), : BorderRadius.circular(widget.raduis),
) boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.1),
spreadRadius: 10,
blurRadius: 5,
offset: Offset(0, 5), // changes position of shadow
),
])
: null, : null,
child: Card( child: Card(
margin: EdgeInsets.all(0), margin: EdgeInsets.all(0),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: widget.customCornerRaduis borderRadius: widget.customCornerRaduis
? BorderRadius.only( ? BorderRadius.only(
topLeft: Radius.circular(widget.topLeft), topLeft: Radius.circular(widget.topLeft),
topRight: Radius.circular(widget.topRight), topRight: Radius.circular(widget.topRight),
bottomRight: Radius.circular(widget.bottomRight), bottomRight: Radius.circular(widget.bottomRight),
bottomLeft: Radius.circular(widget.bottomLeft)) bottomLeft: Radius.circular(widget.bottomLeft))
: BorderRadius.circular(widget.raduis), : BorderRadius.circular(widget.raduis),
), ),
color: widget.backgroundColor, color: widget.backgroundColor,
child: widget.child, child: widget.child,

Loading…
Cancel
Save