import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:fluttertoast/fluttertoast.dart';
class InformationToBeCopied {
final String bottomText;
const InformationToBeCopied({
this.bottomText,
});
@override
toString() {
return 'ive copy this: $bottomText';
}
}
class CallingzCard extends StatelessWidget {
final String toptitle;
final InformationToBeCopied info;
const CallingzCard(
{
Key key,
this.toptitle,
this.info,
}) : super(key: key);
void showtoast() => Fluttertoast.showToast(
msg: (info.toString()),
fontSize: 15,
backgroundColor: Colors.lightGreen,
);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
showtoast();
Clipboard.setData(ClipboardData(text: info.toString()));
},
child: Column(
children: [
Container(
margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
offset: Offset(0.0, 10.0),
blurRadius: 2.0,
spreadRadius: 0.0,
color: Color.fromRGBO(51, 51, 51, 0.16),
),
],
),
child: Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(10, 15, 0, 15),
child: SvgPicture.asset(
'assets/icons/phone-call.svg',
height: 30,
),
),
SizedBox(width: 20),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(0,10,30,0),
child: Text(
toptitle,
style: Theme.of(context).textTheme.subtitle2,
),
),
SizedBox(
height: 5,
),
Padding(
padding: const EdgeInsets.fromLTRB(0,0,30,10),
child: Text(info.bottomText),
)
],
),
),
],
),
),
],
),
);
}
}