You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
157 lines
5.6 KiB
157 lines
5.6 KiB
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:teso/Classes/customTesoButton.dart';
|
|
import 'package:teso/util/SizeConfig.dart';
|
|
import 'package:teso/util/consts.dart';
|
|
import 'package:time_elapsed/time_elapsed.dart';
|
|
|
|
buildPersonalizedAlert(
|
|
{BuildContext context,
|
|
DateTime timestamp,
|
|
Icon icons,
|
|
String thumbnail,
|
|
String message,
|
|
Function accept,
|
|
Function decline}) {
|
|
return Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 30.0),
|
|
child: Material(
|
|
elevation: 10,
|
|
child: Container(
|
|
width: MediaQuery.of(context).size.width,
|
|
color: Theme.of(context).primaryColor,
|
|
// height: 50,
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
constraints: BoxConstraints(minHeight: 129, maxHeight: 170),
|
|
width: MediaQuery.of(context).size.width -
|
|
(MediaQuery.of(context).size.width) * 0.88,
|
|
decoration: BoxDecoration(
|
|
gradient: LinearGradient(
|
|
begin: Alignment.topCenter,
|
|
end: Alignment.bottomCenter,
|
|
colors: [
|
|
darkAccent,
|
|
accentMain,
|
|
],
|
|
),
|
|
),
|
|
child: icons,
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
// color: Theme.of(context).primaryColor,
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Wrap(
|
|
direction: Axis.horizontal,
|
|
runSpacing: 10,
|
|
children: [
|
|
Icon(
|
|
Icons.timer,
|
|
size: 15,
|
|
),
|
|
Text(
|
|
TimeElapsed.fromDateTime(timestamp),
|
|
style: (TextStyle(
|
|
color: Colors.grey,
|
|
)),
|
|
),
|
|
],
|
|
),
|
|
Container(
|
|
width: MediaQuery.of(context).size.width * 0.527,
|
|
child: Text(
|
|
message,
|
|
textAlign: TextAlign.left,
|
|
style: TextStyle(
|
|
fontSize: SizeConfig.blockSizeHorizontal * 3.5,
|
|
),
|
|
),
|
|
),
|
|
Container(),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.all(5),
|
|
child: RaisedGradientButton(
|
|
child: Text(
|
|
"Accept",
|
|
style: TextStyle(
|
|
color: Colors.white, fontSize: 13.5),
|
|
),
|
|
gradient: LinearGradient(
|
|
begin: Alignment.topCenter,
|
|
end: Alignment.bottomCenter,
|
|
colors: [
|
|
accentMain,
|
|
darkAccent,
|
|
//darkAccent,
|
|
],
|
|
),
|
|
onPressed: accept,
|
|
width: 90,
|
|
height: 30,
|
|
),
|
|
),
|
|
Container(
|
|
child: RaisedGradientButton(
|
|
child: Text(
|
|
"Decline",
|
|
style: TextStyle(
|
|
color: Colors.white, fontSize: 13.5),
|
|
),
|
|
gradient: LinearGradient(
|
|
begin: Alignment.topCenter,
|
|
end: Alignment.bottomCenter,
|
|
colors: [
|
|
accentMain,
|
|
darkAccent,
|
|
//darkAccent,
|
|
],
|
|
),
|
|
onPressed: decline,
|
|
width: 90,
|
|
height: 30,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: (MediaQuery.of(context).size.width) * 0.10,
|
|
color: Theme.of(context).primaryColor,
|
|
child: Align(
|
|
alignment: Alignment.topCenter,
|
|
child: CachedNetworkImage(
|
|
imageUrl: productURL + thumbnail,
|
|
imageBuilder: (context, imageProvider) => Image(
|
|
fit: BoxFit.fill,
|
|
width: 40,
|
|
height: 40,
|
|
image: imageProvider,
|
|
),
|
|
),
|
|
// FadeInImage(
|
|
// height: 40,
|
|
// width: 40,
|
|
// fit: BoxFit.fill,
|
|
// image: NetworkImage(),
|
|
// placeholder: AssetImage("assets/images/tesoDP/dp1.png"),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|