update widgets

This commit is contained in:
Ankit Mahato
2025-06-29 01:23:48 +05:30
parent 053d2ea309
commit f98218457a
4 changed files with 93 additions and 63 deletions

View File

@@ -0,0 +1,38 @@
import 'package:apidash_design_system/apidash_design_system.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class LearnButton extends StatelessWidget {
const LearnButton({
super.key,
this.label,
this.icon,
this.url,
});
final String? label;
final IconData? icon;
final String? url;
@override
Widget build(BuildContext context) {
var textLabel = label ?? 'Learn';
return SizedBox(
height: 24,
child: ADFilledButton(
icon: Icons.help,
iconSize: kButtonIconSizeSmall,
label: textLabel,
isTonal: true,
buttonStyle: ButtonStyle(
padding: WidgetStatePropertyAll(kP10),
),
onPressed: () {
if (url != null) {
launchUrl(Uri.parse(url!));
}
},
),
);
}
}