|
|
|
|
@ -1,24 +1,19 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
|
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
/// Button widget
|
|
|
|
|
/// [label] button label
|
|
|
|
|
/// [icon] button icon its optional
|
|
|
|
|
/// FloatingButton widget
|
|
|
|
|
/// [onTap] button function
|
|
|
|
|
/// [loading] show the progress indicator
|
|
|
|
|
/// [elevation] color elevation value
|
|
|
|
|
class FloatingButton extends StatefulWidget {
|
|
|
|
|
FloatingButton(
|
|
|
|
|
{Key key,
|
|
|
|
|
this.onTap,
|
|
|
|
|
this.elevation: true})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
FloatingButton({Key key, this.onTap, this.elevation: true}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
final VoidCallback onTap;
|
|
|
|
|
final bool elevation;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_FloatingButtonState createState() => _FloatingButtonState();
|
|
|
|
|
}
|
|
|
|
|
@ -54,9 +49,9 @@ class _FloatingButtonState extends State<FloatingButton>
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
return (GestureDetector(
|
|
|
|
|
onTapDown: (TapDownDetails tap) {
|
|
|
|
|
_animationController.reverse(from: 1.0);
|
|
|
|
|
@ -74,9 +69,9 @@ class _FloatingButtonState extends State<FloatingButton>
|
|
|
|
|
child: AnimatedContainer(
|
|
|
|
|
duration: Duration(milliseconds: 150),
|
|
|
|
|
margin: EdgeInsets.only(bottom: 4),
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 22, horizontal: 22),
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 24, horizontal: 24),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(45.0)),
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(54.0)),
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
@ -87,29 +82,29 @@ class _FloatingButtonState extends State<FloatingButton>
|
|
|
|
|
offset: Offset(0, 7.0),
|
|
|
|
|
blurRadius: 55.0)
|
|
|
|
|
]),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
//TODO change the icon
|
|
|
|
|
Image.asset("assets/images/blood-drop.png", fit: BoxFit.cover),
|
|
|
|
|
Texts('BOOK',bold: true,color: Colors.white,),
|
|
|
|
|
Texts('APPPINTEMNT',color: Colors.white,fontSize: 7,),
|
|
|
|
|
],
|
|
|
|
|
Icon(EvaIcons.calendar,color: Colors.white,size: 23,),
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).book,
|
|
|
|
|
bold: !projectViewModel.isArabic,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: projectViewModel.isArabic ? 8 : 17,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).appointmentLabel,
|
|
|
|
|
bold: projectViewModel.isArabic,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize:projectViewModel.isArabic ? 8.8 : 8,
|
|
|
|
|
),
|
|
|
|
|
width: 50,
|
|
|
|
|
height: 50,
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
width: 54,
|
|
|
|
|
height: 54,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
));
|
|
|
|
|
|