create doctor card and medical page
|
After Width: | Height: | Size: 408 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 700 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 990 B |
|
After Width: | Height: | Size: 1.5 KiB |
@ -1 +1,2 @@
|
|||||||
|
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||||
#include "Generated.xcconfig"
|
#include "Generated.xcconfig"
|
||||||
|
|||||||
@ -1 +1,2 @@
|
|||||||
|
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||||
#include "Generated.xcconfig"
|
#include "Generated.xcconfig"
|
||||||
|
|||||||
@ -0,0 +1,132 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class MedicalPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_MedicalPageState createState() => _MedicalPageState();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MedicalPageState extends State<MedicalPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AppScaffold(
|
||||||
|
body: CustomScrollView(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
key: PageStorageKey("medical"),
|
||||||
|
slivers: <Widget>[
|
||||||
|
SliverPersistentHeader(
|
||||||
|
delegate: SliverAppBarDelegate(
|
||||||
|
maxHeight: 200.0,
|
||||||
|
minHeight: 200.0,
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 200,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SliverPersistentHeader(
|
||||||
|
delegate: SliverAppBarDelegate(
|
||||||
|
maxHeight: double.maxFinite,
|
||||||
|
minHeight: double.maxFinite,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 12.0),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: 'My Doctor',
|
||||||
|
imagePath: 'doctor_icon.png',
|
||||||
|
subTitle: 'List',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: 'Lab',
|
||||||
|
imagePath: 'lab_result_icon.png',
|
||||||
|
subTitle: 'Result',
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: 'Radiology',
|
||||||
|
imagePath: 'radiology_icon.png',
|
||||||
|
subTitle: 'Service',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: 'Medicines',
|
||||||
|
imagePath: 'prescription_icon.png',
|
||||||
|
subTitle: 'Prescriptions',
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: 'Insurance',
|
||||||
|
imagePath: 'insurance_card_icon.png',
|
||||||
|
subTitle: 'Card',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: 'Insurance',
|
||||||
|
imagePath: 'insurance_approvals_icon.png',
|
||||||
|
subTitle: 'Approvals',
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: MedicalProfileItem(
|
||||||
|
title: 'Medical',
|
||||||
|
imagePath: 'medical_history_icon.png',
|
||||||
|
subTitle: 'Reports',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Container(),
|
||||||
|
)
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
|
class MyAdmissionsPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_MyAdmissionsPageState createState() => _MyAdmissionsPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MyAdmissionsPageState extends State<MyAdmissionsPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AppScaffold(
|
||||||
|
body: ListView(
|
||||||
|
children: <Widget>[
|
||||||
|
AppExpandableNotifier(
|
||||||
|
title: 'Arryan Hospital',
|
||||||
|
bodyWidget: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
DoctorCard(
|
||||||
|
name: 'Dr Mohammad Aljammal',
|
||||||
|
date: 'Feb 14, 2020',
|
||||||
|
profileUrl:
|
||||||
|
'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB',
|
||||||
|
rat: 3.8,
|
||||||
|
subName: 'Jammal',
|
||||||
|
),
|
||||||
|
DoctorCard(
|
||||||
|
name: 'Dr Mohammad Aljammal',
|
||||||
|
date: 'Feb 14, 2020',
|
||||||
|
profileUrl:
|
||||||
|
'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB',
|
||||||
|
rat: 3.8,
|
||||||
|
subName: 'Jammal',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
AppExpandableNotifier(
|
||||||
|
title: 'Arryan Hospital',
|
||||||
|
bodyWidget: DoctorCard(
|
||||||
|
onTap: () {
|
||||||
|
//TODO when we need it
|
||||||
|
},
|
||||||
|
name: 'Dr Mohammad Aljammal',
|
||||||
|
date: 'Feb 14, 2020',
|
||||||
|
profileUrl:
|
||||||
|
'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB',
|
||||||
|
rat: 4.8,
|
||||||
|
subName: 'Jammal',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
|
||||||
|
class DoctorCard extends StatelessWidget {
|
||||||
|
final String name;
|
||||||
|
final String subName;
|
||||||
|
final double rat;
|
||||||
|
final String date;
|
||||||
|
final String profileUrl;
|
||||||
|
final Function onTap;
|
||||||
|
|
||||||
|
DoctorCard(
|
||||||
|
{this.name,
|
||||||
|
this.subName,
|
||||||
|
this.rat,
|
||||||
|
this.date,
|
||||||
|
this.profileUrl,
|
||||||
|
this.onTap});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return RoundedContainer(
|
||||||
|
child: InkWell(
|
||||||
|
onTap: onTap,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: LargeAvatar(
|
||||||
|
name: name,
|
||||||
|
url: profileUrl,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 4,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.all(10),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Texts(
|
||||||
|
name,
|
||||||
|
bold: true,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
subName,
|
||||||
|
variant: 'bodyText',
|
||||||
|
),
|
||||||
|
StarRating(totalAverage: rat, forceStars: true),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Divider(
|
||||||
|
height: 8,
|
||||||
|
color: Colors.grey[400],
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(5.0),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'assets/images/Icon-awesome-calendar.png',
|
||||||
|
width: 30,
|
||||||
|
height: 30,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Texts(
|
||||||
|
date,
|
||||||
|
variant: 'bodyText',
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
|
||||||
|
class MedicalProfileItem extends StatelessWidget {
|
||||||
|
MedicalProfileItem({
|
||||||
|
@required this.imagePath,
|
||||||
|
@required this.title,
|
||||||
|
@required this.subTitle,
|
||||||
|
});
|
||||||
|
|
||||||
|
final String imagePath;
|
||||||
|
final String title;
|
||||||
|
final String subTitle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return RoundedContainer(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(5),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 1.7 * SizeConfig.textMultiplier,
|
||||||
|
color: Hexcolor('#B8382C'),
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
style: TextStyle(color: Colors.black),
|
||||||
|
children: [
|
||||||
|
TextSpan(text: subTitle),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomRight,
|
||||||
|
child: Image.asset(
|
||||||
|
"assets/images/medical/$imagePath",
|
||||||
|
height: SizeConfig.heightMultiplier * 7,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class StarRating extends StatelessWidget {
|
||||||
|
|
||||||
|
final double totalAverage;
|
||||||
|
final double size;
|
||||||
|
final int totalCount;
|
||||||
|
final bool forceStars;
|
||||||
|
|
||||||
|
StarRating({Key key, this.totalAverage: 0.0, this.size: 16.0, this.totalCount, this.forceStars = false}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: <Widget> [
|
||||||
|
if (!forceStars && (totalAverage==null || totalAverage==0))
|
||||||
|
Texts("New", style: "caption"),
|
||||||
|
if (forceStars || (totalAverage!=null && totalAverage>0))
|
||||||
|
...List.generate(5, (index) =>
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(right: 1.0),
|
||||||
|
child: Icon(
|
||||||
|
(index+1) <= (totalAverage ?? 0) ? EvaIcons.star : EvaIcons.starOutline,
|
||||||
|
size: size,
|
||||||
|
color: (index+1) <= (totalAverage ?? 0) ? Color.fromRGBO(255, 186, 0, 1.0) : Theme.of(context).hintColor
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
if (totalCount!=null)
|
||||||
|
SizedBox(width: 9.0),
|
||||||
|
if (totalCount!=null)
|
||||||
|
Texts("("+totalCount.toString()+")", style: "overline", color: Colors.grey[400],)
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
/*
|
||||||
|
*@author: Mohammad Aljammal
|
||||||
|
*@Date:27/4/2020
|
||||||
|
*@param: Widget
|
||||||
|
*@return:
|
||||||
|
*@desc: Card With Bg Widget
|
||||||
|
*/
|
||||||
|
|
||||||
|
class CardWithBgWidget extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
|
CardWithBgWidget({@required this.child});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectProvider = Provider.of(context);
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 10.0),
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(10.0),
|
||||||
|
),
|
||||||
|
border: Border.all(color: Colors.grey, width: 1.0),
|
||||||
|
),
|
||||||
|
child: Material(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
if (projectProvider.isArabic)
|
||||||
|
Positioned(
|
||||||
|
child: Container(
|
||||||
|
width: 10,
|
||||||
|
color: Hexcolor('#58434F'),
|
||||||
|
),
|
||||||
|
bottom: 0,
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
)
|
||||||
|
else
|
||||||
|
Positioned(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(9.0),
|
||||||
|
bottomLeft: Radius.circular(9.0),
|
||||||
|
),color: Colors.blueAccent,
|
||||||
|
|
||||||
|
),
|
||||||
|
width: 15,
|
||||||
|
|
||||||
|
),
|
||||||
|
bottom: 0,
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(15.0),
|
||||||
|
margin: EdgeInsets.only(left: 10),
|
||||||
|
child: child)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,86 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
/// DESCRIPTION : Custom widget for rounded container and custom decoration
|
||||||
|
|
||||||
|
class RoundedContainer extends StatefulWidget {
|
||||||
|
final double width;
|
||||||
|
final double height;
|
||||||
|
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 child;
|
||||||
|
final double borderWidth;
|
||||||
|
|
||||||
|
RoundedContainer(
|
||||||
|
{@required this.child,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.raduis = 10,
|
||||||
|
this.backgroundColor = Colors.white,
|
||||||
|
this.margin = 10,
|
||||||
|
this.elevation = 1,
|
||||||
|
this.showBorder = false,
|
||||||
|
this.borderColor = Colors.grey,
|
||||||
|
this.customCornerRaduis = false,
|
||||||
|
this.topLeft = 0,
|
||||||
|
this.topRight = 0,
|
||||||
|
this.bottomRight = 0,
|
||||||
|
this.bottomLeft = 0,
|
||||||
|
this.borderWidth = 1});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_RoundedContainerState createState() => _RoundedContainerState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RoundedContainerState extends State<RoundedContainer> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: widget.width,
|
||||||
|
height: widget.height,
|
||||||
|
margin: EdgeInsets.all(widget.margin),
|
||||||
|
decoration: widget.showBorder == true
|
||||||
|
? BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: widget.borderColor, width: widget.borderWidth),
|
||||||
|
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),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.grey.withOpacity(0.1),
|
||||||
|
spreadRadius: 10,
|
||||||
|
blurRadius: 5,
|
||||||
|
offset: Offset(0, 5), // changes position of shadow
|
||||||
|
),
|
||||||
|
])
|
||||||
|
: 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.child,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
|
class SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
|
||||||
|
SliverAppBarDelegate({
|
||||||
|
@required this.minHeight,
|
||||||
|
@required this.maxHeight,
|
||||||
|
@required this.child,
|
||||||
|
});
|
||||||
|
|
||||||
|
final double minHeight;
|
||||||
|
final double maxHeight;
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
|
@override
|
||||||
|
double get minExtent => minHeight;
|
||||||
|
|
||||||
|
@override
|
||||||
|
double get maxExtent => max(maxHeight, minHeight);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(
|
||||||
|
BuildContext context,
|
||||||
|
double shrinkOffset,
|
||||||
|
bool overlapsContent)
|
||||||
|
{
|
||||||
|
return new SizedBox.expand(child: child);
|
||||||
|
}
|
||||||
|
@override
|
||||||
|
bool shouldRebuild(SliverAppBarDelegate oldDelegate) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||