import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../module/browser/browser_page.dart';

class ClickTextSpan extends TextSpan {
  ClickTextSpan({
    required String text,
    required String url,
    double? fontSize,
    Color color = const Color(0xFF459FFF),
    FontWeight fontWeight = FontWeight.w400,
  }) : super(
         text: text,
         style: TextStyle(
           color: color,
           fontSize: fontSize ?? 10.sp,
           fontWeight: fontWeight,
         ),
         recognizer:
             TapGestureRecognizer()
               ..onTap = () {
                 BrowserPage.start(url);
               },
       );
}
