-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add social_link widget, add developer page to home_drawer with name t…
…eam and rename company.png to outlook.png
- Loading branch information
1 parent
d4e287a
commit f4e1443
Showing
5 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
import 'package:onestop_dev/functions/utility/show_snackbar.dart'; | ||
|
||
class SocialLink extends StatelessWidget { | ||
const SocialLink({ | ||
super.key, | ||
required this.url, | ||
required this.imagePath, | ||
}); | ||
|
||
final String url; | ||
final String imagePath; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
Future<void> launchURL(String url) async { | ||
final Uri uri = Uri.parse(url); | ||
if (!await launchUrl( | ||
uri, | ||
mode: LaunchMode.externalApplication, | ||
)) { | ||
throw "Can not launch url"; | ||
} | ||
} | ||
|
||
return GestureDetector( | ||
onTap: () async { | ||
try { | ||
await launchURL(url); | ||
} catch (e) { | ||
showSnackBar(e.toString()); | ||
} | ||
}, | ||
child: Image.asset(imagePath), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters