urlButton function

Widget? urlButton(
  1. BuildContext context, {
  2. String? text,
  3. String? url,
})

Implementation

Widget? urlButton(BuildContext context, {String? text, String? url}) {
  if (text == null && url == null) return null;
  if (url == null) {
    return textField(context, text: text!);
  } else {
    String label = text ?? url;
    return OutlinedButton(
      onPressed: () => lazy.openUrl(url),
      style: buttonStyleRound(),
      child: Text(
        label,
        style: textStyleBodyS(context),
      ),
    );
  }
}