lead_phone.dart 608 B

12345678910111213141516171819202122
  1. import 'package:flutter/material.dart';
  2. import 'package:url_launcher/url_launcher.dart';
  3. class LeaderPhone extends StatelessWidget {
  4. final String imageUrl;
  5. final String phone;
  6. LeaderPhone({Key key, @required this.imageUrl, @required this.phone}) : super(key: key);
  7. @override
  8. Widget build(BuildContext context) {
  9. return SliverToBoxAdapter(
  10. child: Container(
  11. child: InkWell(
  12. child: Image.network(imageUrl, fit: BoxFit.cover),
  13. onTap: () async {
  14. var url = 'tel:$phone';
  15. if (await canLaunch(url)) launch(url);
  16. }),
  17. ));
  18. }
  19. }