content: import 'dart:developer';
  import 'package:tec/constant/my_colors.dart';
  import 'package:get/get.dart';
  import 'package:flutter/material.dart';
  import 'package:tec/gen/assets.gen.dart';
  import 'package:tec/component/text_style.dart';
  import 'package:url_launcher/url_launcher.dart';
  import 'package:flutter_spinkit/flutter_spinkit.dart';
  import 'package:tec/controller/home_screen_controller.dart';
  
  class TechDivider extends StatelessWidget {
    const TechDivider({
      Key? key,
      required this.size,
    }) : super(key: key);
  
    final Size size;
  
    @override
    Widget build(BuildContext context) {
      return Divider(
        thickness: 1.5,
        color: SolidColors.dividerColor,
        indent: size.width / 6,
        endIndent: size.width / 6,
      );
    }
  }
  
  class MainTags extends StatelessWidget {
    const MainTags({
      Key? key,
      required this.textTheme,
      required this.index,
    }) : super(key: key);
  
    final TextTheme textTheme;
    final int index;
  
    @override
    Widget build(BuildContext context) {
      return Container(
        height: 60,
        decoration: const BoxDecoration(
          borderRadius: BorderRadius.all(Radius.circular(24)),
          gradient: LinearGradient(
              colors: GradientColors.tags,
              begin: Alignment.centerRight,
              end: Alignment.centerLeft),
        ),
        child: Padding(
          padding: const EdgeInsets.fromLTRB(16, 8, 8, 8),
          child: Row(
            children: [
              ImageIcon(
                Image.asset(Assets.icons.hashtagicon.path).image,
                color: Colors.white,
                size: 16,
              ),
              const SizedBox(
                width: 8,
              ),
              Text(
                Get.find<HomeScreenController>().tagsList[index].title!,
                style: textTheme.displayMedium,
              )
            ],
          ),
        ),
      );
    }
  }
  
  myLaunchUrl(String url) async {
    var uri = Uri.parse(url);
    if (await canLaunchUrl(uri)) {
      await launchUrl(uri);
    } else {
      log("could not launch ${uri.toString()}");
    }
  }
  
  class Loading extends StatelessWidget {
    const Loading({
      Key? key,
    }) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return const SpinKitFadingCube(
        color: SolidColors.primaryColor,
        size: 32.0,
      );
    }
  }
  
  PreferredSize appBar(String title) {
    return PreferredSize(
      preferredSize: const Size.fromHeight(60),
      child: Padding(
        padding: const EdgeInsets.all(12.0),
        child: AppBar(
          backgroundColor: Colors.transparent,
          elevation: 0,
          actions: [
            Padding(
              padding: const EdgeInsets.only(left: 16),
              child: Center(
                  child: Text(
                title,
                style: appBarTextStyle,
              )),
            ),
          ],
          leading: GestureDetector(
            onTap: () {
              Get.back();
            },
            child: Padding(
              padding: const EdgeInsets.only(right: 16),
              child: Container(
                height: 40,
                width: 40,
                decoration: BoxDecoration(
                  color: SolidColors.primaryColor.withBlue(100),
                  shape: BoxShape.circle,
                ),
                child: const Icon(Icons.keyboard_arrow_right_rounded),
              ),
            ),
          ),
        ),
      ),
    );
  }
  
  class SeeMoreBlog extends StatelessWidget {
    const SeeMoreBlog({
      Key? key,
      required this.bodyMargin,
      required this.textTheme,
      required this.title,
    }) : super(key: key);
  
    final double bodyMargin;
    final TextTheme textTheme;
    final String title;
  
    @override
    Widget build(BuildContext context) {
      return Padding(
        padding: EdgeInsets.only(right: bodyMargin, bottom: 8),
        child: Row(
          children: [
            ImageIcon(
              Image.asset(Assets.icons.bluePen.path).image,
              color: SolidColors.seeMore,
            ),
            const SizedBox(
              width: 8,
            ),
            Text(
              title,
              style: textTheme.displaySmall,
            )
          ],
        ),
      );
    }
  }
  