fix: review changes

This commit is contained in:
DenserMeerkat
2024-06-24 23:41:52 +05:30
parent 7852fe98e5
commit 2f8a1ef9b2
74 changed files with 1929 additions and 1811 deletions

View File

@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:apidash/consts.dart';
class RepoButton extends StatelessWidget {
const RepoButton({
super.key,
this.text,
this.icon,
});
final String? text;
final IconData? icon;
@override
Widget build(BuildContext context) {
var label = text ?? "GitHub";
if (icon == null) {
return FilledButton(
onPressed: () {
launchUrl(Uri.parse(kGitUrl));
},
child: Text(
label,
style: kTextStyleButton,
),
);
}
return FilledButton.icon(
onPressed: () {
launchUrl(Uri.parse(kGitUrl));
},
icon: Icon(
icon,
size: 20.0,
),
label: Text(
label,
style: kTextStyleButton,
),
);
}
}