Fixes & code optimizations
parent
5692bc66a9
commit
f029aaa1c6
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1,61 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CardCommonEr extends StatelessWidget {
|
||||
final image;
|
||||
final text;
|
||||
final subText;
|
||||
final bool locked;
|
||||
|
||||
final Function onTap;
|
||||
const CardCommonEr({
|
||||
this.locked = false,
|
||||
@required this.image,
|
||||
@required this.text,
|
||||
@required this.subText,
|
||||
@required this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: locked ? null : onTap,
|
||||
child: Opacity(
|
||||
opacity: locked ? 0.25 : 1.0,
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Color(0xffefefef),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Image.asset(this.image, width: 42.0, height: 42.0),
|
||||
Text(
|
||||
text + "${subText.isEmpty ? "" : "\n$subText"}",
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (locked) Align(alignment: Alignment.center, child: lock())
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget lock() {
|
||||
return Container(
|
||||
child: Icon(Icons.lock_rounded, size: 80),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,106 +0,0 @@
|
||||
//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:giffy_dialog/giffy_dialog.dart';
|
||||
import 'package:maps_launcher/maps_launcher.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class CardPosition extends StatelessWidget {
|
||||
final image;
|
||||
final text;
|
||||
final subText;
|
||||
final type;
|
||||
final telephone;
|
||||
final networkImage;
|
||||
final latitude;
|
||||
final longitude;
|
||||
final projectname;
|
||||
final cardSize;
|
||||
final String waitingTime;
|
||||
|
||||
const CardPosition({
|
||||
@required this.image,
|
||||
@required this.text,
|
||||
@required this.subText,
|
||||
@required this.type,
|
||||
@required this.telephone,
|
||||
@required this.networkImage,
|
||||
@required this.latitude,
|
||||
@required this.longitude,
|
||||
@required this.projectname,
|
||||
@required this.cardSize,
|
||||
@required this.waitingTime,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
navigateToSearch(context, this.type, this.telephone, this.networkImage, this.latitude, this.longitude, this.projectname);
|
||||
},
|
||||
child: Container(
|
||||
// width:MediaQuery.of(context).size.width * 0.47,//165,
|
||||
margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 8.0),
|
||||
decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)], borderRadius: BorderRadius.circular(10), color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: cardSize * 0.2 - 8,
|
||||
margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 0.0),
|
||||
child: Text(this.text, overflow: TextOverflow.clip, style: TextStyle(color: Colors.black, letterSpacing: 1.0, fontSize: 2 * SizeConfig.textMultiplier)),
|
||||
),
|
||||
Container(
|
||||
height: cardSize * 0.5 - 8,
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.fromLTRB(0.0, 0.0, 8.0, 8.0),
|
||||
child: Image.asset(this.image, width: 60.0, height: cardSize * 0.4),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
|
||||
height: cardSize * 0.2 - 8,
|
||||
child: Text(this.subText, overflow: TextOverflow.clip, style: TextStyle(color: Color(0xFFc5272d), letterSpacing: 1.0, fontSize: 15.0)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future navigateToSearch(context, type, telephone, networkImage, latitude, longitude, projectname) async {
|
||||
var localize = TranslationBase.of(context);
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => AssetGiffyDialog(
|
||||
entryAnimation: EntryAnimation.BOTTOM,
|
||||
image: Image.network(
|
||||
networkImage,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
title: Text(
|
||||
projectname,
|
||||
style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
|
||||
),
|
||||
description: Text(
|
||||
"${localize.averageWaitingTime}\n\n$waitingTime ${localize.minute}",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
buttonOkText: Text(
|
||||
"LOCATION",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
buttonOkColor: Colors.grey,
|
||||
buttonCancelText: Text(
|
||||
'CAll',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
buttonCancelColor: Colors.grey,
|
||||
onOkButtonPressed: () {
|
||||
MapsLauncher.launchCoordinates(double.parse(latitude), double.parse(longitude), projectname);
|
||||
},
|
||||
onCancelButtonPressed: () {
|
||||
launch("tel://" + telephone);
|
||||
}));
|
||||
}
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppBarChart extends StatelessWidget {
|
||||
const AppBarChart({
|
||||
Key key,
|
||||
@required this.isArabic,
|
||||
@required this.seriesList,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<charts.Series> seriesList;
|
||||
final bool isArabic;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 400,
|
||||
//margin: EdgeInsets.only(top: 60),
|
||||
child: charts.BarChart(
|
||||
seriesList,
|
||||
// animate: animate,
|
||||
domainAxis: charts.OrdinalAxisSpec(
|
||||
renderSpec: charts.GridlineRendererSpec(
|
||||
labelAnchor: isArabic ? charts.TickLabelAnchor.before : charts.TickLabelAnchor.after,
|
||||
labelRotation: -30,
|
||||
labelOffsetFromAxisPx: 30,
|
||||
labelOffsetFromTickPx: 15,
|
||||
labelJustification: charts.TickLabelJustification.inside,
|
||||
),
|
||||
),
|
||||
|
||||
/// Customize the primary measure axis using a small tick renderer.
|
||||
/// Use String instead of num for ordinal domain axis
|
||||
/// (typically bar charts).
|
||||
primaryMeasureAxis: new charts.NumericAxisSpec(
|
||||
renderSpec: new charts.GridlineRendererSpec(
|
||||
// Display the measure axis labels below the gridline.
|
||||
//
|
||||
// 'Before' & 'after' follow the axis value direction.
|
||||
// Vertical axes draw 'before' below & 'after' above the tick.
|
||||
// Horizontal axes draw 'before' left & 'after' right the tick.
|
||||
labelAnchor: charts.TickLabelAnchor.before,
|
||||
|
||||
// Left justify the text in the axis.
|
||||
//
|
||||
// Note: outside means that the secondary measure axis would right
|
||||
// justify.
|
||||
labelJustification: charts.TickLabelJustification.outside,
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// chart line
|
||||
/// [seriesList] charts series
|
||||
/// [chartTitle] the charts title
|
||||
/// [animate] enable and disable animate on create chart
|
||||
/// [includeArea] chart include Area
|
||||
/// [stacked] stacked chart over the design
|
||||
class AppLineChart extends StatelessWidget {
|
||||
final List<charts.Series> seriesList;
|
||||
final String chartTitle;
|
||||
final bool animate;
|
||||
final bool includeArea;
|
||||
final bool stacked;
|
||||
|
||||
AppLineChart(
|
||||
{Key key,
|
||||
@required this.seriesList,
|
||||
this.chartTitle,
|
||||
this.animate = true,
|
||||
this.includeArea = false,
|
||||
this.stacked = true});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
chartTitle,
|
||||
style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold),
|
||||
),
|
||||
Expanded(
|
||||
child: charts.LineChart(seriesList,
|
||||
defaultRenderer: charts.LineRendererConfig(
|
||||
includeArea: false, stacked: true),
|
||||
animate: animate),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue