import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:tone_snap/components/base_appbar.dart';
import 'package:tone_snap/generated/assets.dart';
import 'package:tone_snap/global/app_config.dart';
import 'package:tone_snap/modules/sidea/about/about_controller.dart';

class AboutView extends StatelessWidget {
  AboutView({super.key});

  final controller = Get.find<AboutController>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: const BaseAppBar('About'),
      body: Container(
        alignment: Alignment.topCenter,
        child: Column(
          children: [
            SizedBox(height: 60.h),
            Image.asset(
              Assets.iconAppIcon,
              width: 120.w,
              height: 120.w,
            ),
            SizedBox(height: 20.h),
            Obx(() {
              return RichText(
                maxLines: 2,
                overflow: TextOverflow.ellipsis,
                textAlign: TextAlign.center,
                text: TextSpan(
                  text: AppConfig.appName,
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 22.sp,
                    fontWeight: FontWeight.w600,
                  ),
                  children: [
                    TextSpan(
                      text: '\n${controller.versionName.value}',
                      style: TextStyle(
                        color: Colors.white,
                        fontSize: 12.sp,
                        fontWeight: FontWeight.w600,
                      ),
                    ),
                    WidgetSpan(
                      child: SizedBox(height: 20.h),
                    ),
                  ],
                ),
              );
            }),
          ],
        ),
      ),
    );
  }
}
