Merge branch 'develop' into 'master'
dashboard screen and rounded container widget See merge request Cloud_Solution/doctor_app_flutter!6merge-requests/7/merge
commit
00c302ad5a
Binary file not shown.
@ -1,42 +0,0 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// OWNER : Ibrahim albitar
|
||||
// DATE : 05-04-2020
|
||||
// DESCRIPTION : Custom widget for rounded container and custom decoration
|
||||
|
||||
class RoundedContainer extends StatefulWidget {
|
||||
|
||||
final double raduis;
|
||||
final Color backgroundColor;
|
||||
final double margin;
|
||||
final double elevation;
|
||||
final bool showBorder;
|
||||
final Color borderColor;
|
||||
final Widget widget;
|
||||
|
||||
RoundedContainer(this.widget ,{this.raduis = 10,this.backgroundColor = Colors.white, this.margin = 10, this.elevation = 1, this.showBorder = false, this.borderColor = Colors.red});
|
||||
|
||||
@override
|
||||
_RoundedContainerState createState() => _RoundedContainerState();
|
||||
}
|
||||
|
||||
class _RoundedContainerState extends State<RoundedContainer> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.all(widget.margin),
|
||||
decoration: widget.showBorder == true ? BoxDecoration(
|
||||
border: Border.all(color: Colors.red, width:1 ),
|
||||
borderRadius: BorderRadius.circular(widget.raduis),
|
||||
):null,
|
||||
child: Card(
|
||||
margin: EdgeInsets.all(0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(widget.raduis),
|
||||
),
|
||||
color: widget.backgroundColor,
|
||||
child: widget.widget ,
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -1,213 +0,0 @@
|
||||
import 'package:doctor_app_flutter/custom_widgets/dashboard_item_icons_texts.dart';
|
||||
import 'package:doctor_app_flutter/custom_widgets/dashboard_item_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/custom_widgets/rounded_container_widget.dart';
|
||||
import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:percent_indicator/circular_percent_indicator.dart';
|
||||
|
||||
|
||||
class DashboardPage extends StatefulWidget {
|
||||
DashboardPage({Key key, this.title}) : super(key: key);
|
||||
|
||||
final String title;
|
||||
|
||||
@override
|
||||
_MyHomePageState createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<DashboardPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.red[100],
|
||||
textTheme: TextTheme(
|
||||
title:
|
||||
TextStyle(color: Colors.black, fontWeight: FontWeight.bold)),
|
||||
title: Text(widget.title),
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.menu),
|
||||
color: Colors.black,
|
||||
onPressed: () => Scaffold.of(context).openDrawer(),
|
||||
),
|
||||
centerTitle: true,
|
||||
actions: <Widget>[
|
||||
IconButton(icon: Icon(Icons.person), onPressed: null)
|
||||
],
|
||||
),
|
||||
drawer: Container(
|
||||
child: Card(),
|
||||
),
|
||||
bottomNavigationBar: BottomNavigationBar(items:[
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(DoctorApp.home_icon),
|
||||
title: Text('Home'),
|
||||
backgroundColor: Colors.red,
|
||||
activeIcon: Icon(Icons.home)
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: new Icon(Icons.mail),
|
||||
title: new Text('Messages'),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.apps),
|
||||
title: Text('Menu')
|
||||
)
|
||||
]),
|
||||
body: Container(
|
||||
decoration: new BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.red[100], Colors.white],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Today's Statistics",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: RoundedContainer(
|
||||
CircularPercentIndicator(
|
||||
radius: 90.0,
|
||||
animation: true,
|
||||
animationDuration: 1200,
|
||||
lineWidth: 7.0,
|
||||
percent: .75,
|
||||
center: Column( mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
"38",
|
||||
style: new TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24.0),
|
||||
),
|
||||
new Text(
|
||||
"Out-Patients",
|
||||
style: new TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 11.0,
|
||||
color: Colors.grey[800]),
|
||||
),
|
||||
],),
|
||||
circularStrokeCap: CircularStrokeCap.butt,
|
||||
backgroundColor: Colors.blueGrey[100],
|
||||
progressColor: Colors.red,
|
||||
)
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: DashboardItemTexts("Arrived","23",)),
|
||||
Expanded(
|
||||
child: DashboardItemTexts("Not Arrived","23",)),
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: DashboardItemTexts("ER","23",)),
|
||||
Expanded(
|
||||
child: DashboardItemTexts("Walk-in","23",)),
|
||||
],
|
||||
)),
|
||||
],
|
||||
))
|
||||
])),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(DoctorApp.home_icon,"08", "Lab Result", backgroundColor: Colors.red,)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(DoctorApp.home_icon, "10","Radiology", 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: Text(
|
||||
"Patient Services",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 15),
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(DoctorApp.home_icon,"","Search Patient", showBorder: false,backgroundColor: Colors.green[200],)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(DoctorApp.home_icon,"","Out Patient", showBorder: false,backgroundColor: Colors.deepPurple[300],)),
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(DoctorApp.home_icon,"","In Patient", showBorder: false, backgroundColor: Colors.blueGrey[900],)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(DoctorApp.home_icon,"","Discharge Patient", showBorder: false,backgroundColor: Colors.brown[400],)),
|
||||
],
|
||||
)),
|
||||
],
|
||||
)));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,279 @@
|
||||
|
||||
import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart';
|
||||
import 'package:doctor_app_flutter/widgets/dashboard/dashboard_item_icons_texts.dart';
|
||||
import 'package:doctor_app_flutter/widgets/dashboard/dashboard_item_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:percent_indicator/circular_percent_indicator.dart';
|
||||
|
||||
class DashboardPage extends StatefulWidget {
|
||||
DashboardPage({Key key, this.title}) : super(key: key);
|
||||
|
||||
final String title;
|
||||
|
||||
@override
|
||||
_MyHomePageState createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<DashboardPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.red[100],
|
||||
textTheme: TextTheme(
|
||||
title:
|
||||
TextStyle(color: Colors.black, fontWeight: FontWeight.bold)),
|
||||
title: Text(widget.title),
|
||||
leading: Builder(builder: (BuildContext context) {
|
||||
return new GestureDetector(
|
||||
onTap: () {
|
||||
Scaffold.of(context).openDrawer();
|
||||
},
|
||||
child: IconButton(
|
||||
icon: Icon(Icons.menu),
|
||||
color: Colors.black,
|
||||
onPressed: () => Scaffold.of(context).openDrawer(),
|
||||
),
|
||||
);
|
||||
}),
|
||||
centerTitle: true,
|
||||
actions: <Widget>[
|
||||
IconButton(icon: Icon(Icons.person), onPressed: null)
|
||||
],
|
||||
),
|
||||
drawer: SafeArea( child: AppDrawer()),
|
||||
bottomNavigationBar: BottomNavigationBar(items: [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(DoctorApp.home_icon),
|
||||
title: Text('Home'),
|
||||
backgroundColor: Colors.red,
|
||||
activeIcon: Icon(Icons.home)),
|
||||
BottomNavigationBarItem(
|
||||
icon: new Icon(Icons.mail),
|
||||
title: new Text('Messages'),
|
||||
),
|
||||
BottomNavigationBarItem(icon: Icon(Icons.apps), title: Text('Menu'))
|
||||
]),
|
||||
body: Container(
|
||||
decoration: new BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.red[100], Colors.white],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Text(
|
||||
"Today's Statistics",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: RoundedContainer(
|
||||
CircularPercentIndicator(
|
||||
radius: 90.0,
|
||||
animation: true,
|
||||
animationDuration: 1200,
|
||||
lineWidth: 7.0,
|
||||
percent: .75,
|
||||
center: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
"38",
|
||||
style: new TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 24.0),
|
||||
),
|
||||
new Text(
|
||||
"Out-Patients",
|
||||
style: new TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 11.0,
|
||||
color: Colors.grey[800]),
|
||||
),
|
||||
],
|
||||
),
|
||||
circularStrokeCap: CircularStrokeCap.butt,
|
||||
backgroundColor: Colors.blueGrey[100],
|
||||
progressColor: Colors.red,
|
||||
)
|
||||
)
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: DashboardItemTexts(
|
||||
"Arrived",
|
||||
"23",
|
||||
)),
|
||||
Expanded(
|
||||
child: DashboardItemTexts(
|
||||
"Not Arrived",
|
||||
"23",
|
||||
)),
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: DashboardItemTexts(
|
||||
"ER",
|
||||
"23",
|
||||
)),
|
||||
Expanded(
|
||||
child: DashboardItemTexts(
|
||||
"Walk-in",
|
||||
"23",
|
||||
)),
|
||||
],
|
||||
)),
|
||||
],
|
||||
))
|
||||
])),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(
|
||||
DoctorApp.home_icon,
|
||||
"08",
|
||||
"Lab Result",
|
||||
backgroundColor: Colors.red,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(
|
||||
DoctorApp.home_icon,
|
||||
"10",
|
||||
"Radiology",
|
||||
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: Text(
|
||||
"Patient Services",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 15),
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(
|
||||
DoctorApp.home_icon,
|
||||
"",
|
||||
"Search Patient",
|
||||
showBorder: false,
|
||||
backgroundColor: Colors.green[200],
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(
|
||||
DoctorApp.home_icon,
|
||||
"",
|
||||
"Out Patient",
|
||||
showBorder: false,
|
||||
backgroundColor: Colors.deepPurple[300],
|
||||
)),
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(
|
||||
DoctorApp.home_icon,
|
||||
"",
|
||||
"In Patient",
|
||||
showBorder: false,
|
||||
backgroundColor: Colors.blueGrey[900],
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: new DashboardItemIconText(
|
||||
DoctorApp.home_icon,
|
||||
"",
|
||||
"Discharge Patient",
|
||||
showBorder: false,
|
||||
backgroundColor: Colors.brown[400],
|
||||
)),
|
||||
],
|
||||
)),
|
||||
],
|
||||
)));
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
import 'package:doctor_app_flutter/custom_widgets/rounded_container_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DashboardItemTexts extends StatefulWidget {
|
||||
@ -0,0 +1,54 @@
|
||||
import 'package:doctor_app_flutter/widgets/shared/drawer_item_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// OWNER : Ibrahim albitar
|
||||
// DATE : 06-04-2020
|
||||
// DESCRIPTION : Custom App Drawer for app.
|
||||
|
||||
class AppDrawer extends StatefulWidget {
|
||||
@override
|
||||
_AppDrawerState createState() => _AppDrawerState();
|
||||
}
|
||||
|
||||
class _AppDrawerState extends State<AppDrawer> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return
|
||||
|
||||
RoundedContainer(
|
||||
Drawer(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: <Widget>[
|
||||
DrawerHeader(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
CircleAvatar(
|
||||
radius: 40,
|
||||
backgroundImage: NetworkImage("https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png"),
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
Padding(padding: EdgeInsets.only(top: 10), child: Text("Dr. Chris evans", style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold , color: Colors.white), )),
|
||||
Text("Director of medical records", style: TextStyle(fontSize: 14, fontWeight: FontWeight.normal, color: Colors.white),)
|
||||
],
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x58434F)
|
||||
),
|
||||
),
|
||||
DrawerItem()
|
||||
])
|
||||
),
|
||||
margin: 0,
|
||||
customCornerRaduis: true,
|
||||
topRight: 30,
|
||||
bottomRight: 30,
|
||||
backgroundColor: Color(0xff58434F),
|
||||
);
|
||||
}
|
||||
drawerNavigator(context, routeName) {
|
||||
Navigator.of(context).pushNamed(routeName);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// OWNER : Ibrahim albitar
|
||||
// DATE : 08-04-2020
|
||||
// DESCRIPTION : Custom Drawer item for app.
|
||||
|
||||
class DrawerItem extends StatefulWidget {
|
||||
@override
|
||||
_DrawerItemState createState() => _DrawerItemState();
|
||||
}
|
||||
|
||||
class _DrawerItemState extends State<DrawerItem> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Icon(DoctorApp.home_icon,color: Colors.white,),
|
||||
Text("data",style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),),
|
||||
],);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// OWNER : Ibrahim albitar
|
||||
// DATE : 05-04-2020
|
||||
// DESCRIPTION : Custom widget for rounded container and custom decoration
|
||||
|
||||
class RoundedContainer extends StatefulWidget {
|
||||
final double raduis;
|
||||
final Color backgroundColor;
|
||||
final double margin;
|
||||
final double elevation;
|
||||
final bool showBorder;
|
||||
final Color borderColor;
|
||||
final bool customCornerRaduis;
|
||||
final double topLeft;
|
||||
final double bottomRight;
|
||||
final double topRight;
|
||||
final double bottomLeft;
|
||||
final Widget widget;
|
||||
|
||||
RoundedContainer(
|
||||
this.widget,
|
||||
{this.raduis = 10,
|
||||
this.backgroundColor = Colors.white,
|
||||
this.margin = 10,
|
||||
this.elevation = 1,
|
||||
this.showBorder = false,
|
||||
this.borderColor = Colors.red,
|
||||
this.customCornerRaduis = false,
|
||||
this.topLeft = 0,
|
||||
this.topRight = 0,
|
||||
this.bottomRight = 0,
|
||||
this.bottomLeft = 0,
|
||||
});
|
||||
|
||||
@override
|
||||
_RoundedContainerState createState() => _RoundedContainerState();
|
||||
}
|
||||
|
||||
class _RoundedContainerState extends State<RoundedContainer> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.all(widget.margin),
|
||||
decoration: widget.showBorder == true
|
||||
? BoxDecoration(
|
||||
border: Border.all(color: Colors.red, width: 1),
|
||||
borderRadius: widget.customCornerRaduis
|
||||
? BorderRadius.only(
|
||||
topLeft: Radius.circular(widget.topLeft),
|
||||
topRight: Radius.circular(widget.topRight),
|
||||
bottomRight: Radius.circular(widget.bottomRight),
|
||||
bottomLeft: Radius.circular(widget.bottomLeft))
|
||||
: BorderRadius.circular(widget.raduis),
|
||||
)
|
||||
: null,
|
||||
child: Card(
|
||||
margin: EdgeInsets.all(0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: widget.customCornerRaduis
|
||||
? BorderRadius.only(
|
||||
topLeft: Radius.circular(widget.topLeft),
|
||||
topRight: Radius.circular(widget.topRight),
|
||||
bottomRight: Radius.circular(widget.bottomRight),
|
||||
bottomLeft: Radius.circular(widget.bottomLeft))
|
||||
: BorderRadius.circular(widget.raduis),
|
||||
),
|
||||
color: widget.backgroundColor,
|
||||
child: widget.widget,
|
||||
));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue