import 'package:app/widgets/base/card/g_card.dart';
import 'package:flutter/material.dart';
import 'package:remixicon/remixicon.dart';

class TipCard1 extends StatelessWidget {
  const TipCard1({super.key});

  @override
  Widget build(BuildContext context) {
    final list = [
      {
        "icon": RemixIcons.video_on_line,
        "title": "实时视频互动",
        "subtitle": "高清视频连接，随时与学生面对面交流",
      },
      {
        "icon": RemixIcons.file_list_line,
        "title": "查看学生资料",
        "subtitle": "查看学生上传的作业、题目和笔记",
      },
      {
        "icon": RemixIcons.message_line,
        "title": "灵活管控",
        "subtitle": "一键控制学生的视频、音频状态",
      },
      {
        "icon": RemixIcons.lightbulb_line,
        "title": "白板演示",
        "subtitle": "开启白板功能，为学生讲解疑难问题",
      },
    ];
    return Container(
      margin: EdgeInsets.only(top: 15),
      child: Column(
        spacing: 10,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text("核心功能"),
          GridView.builder(
            shrinkWrap: true,
            physics: const NeverScrollableScrollPhysics(),
            gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
              crossAxisCount: 2,
              mainAxisExtent: 80,
              crossAxisSpacing: 15,
              mainAxisSpacing: 15,
            ),
            itemBuilder: (_, index) {
              final item = list[index] as dynamic;
              return GCard(
                child: Row(
                  spacing: 10,
                  children: [
                    Container(
                      width: 50,
                      height: 50,
                      decoration: BoxDecoration(
                        color: Theme.of(context).primaryColor,
                        borderRadius: BorderRadius.circular(10),
                      ),
                      child: Icon(
                        item["icon"],
                        color: Colors.white,
                      ),
                    ),
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        Text(item["title"]),
                        Text(
                          item["subtitle"],
                          style: Theme.of(context).textTheme.labelLarge,
                        ),
                      ],
                    ),
                  ],
                ),
              );
            },
            itemCount: list.length,
          ),
        ],
      ),
    );
  }
}

class TipCard2 extends StatelessWidget {
  const TipCard2({super.key});

  @override
  Widget build(BuildContext context) {
    final tipList = [
      "请确保网络环境良好，保证视频通话质量",
      "建议提前5分钟进入自习室，准备教学材料",
      "合理使用白板功能，帮助学生更好地理解知识点",
      "关注每位学生的学习状态，及时提供帮助",
    ];
    return Container(
      margin: EdgeInsets.only(top: 15),
      padding: EdgeInsets.all(15),
      decoration: BoxDecoration(
        color: Color(0xfffffbeb),
        borderRadius: BorderRadius.circular(10),
        border: Border.all(
          color: Color(0xfffee685),
        ),
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            margin: EdgeInsets.only(bottom: 10),
            child: Text("温馨提示"),
          ),
          ListView.separated(
            shrinkWrap: true,
            physics: const NeverScrollableScrollPhysics(),
            itemBuilder: (_, index) {
              return Row(
                spacing: 4,
                children: [
                  Container(
                    width: 5,
                    height: 5,
                    decoration: BoxDecoration(shape: BoxShape.circle, color: Colors.black),
                  ),
                  Text(
                    tipList[index],
                    style: Theme.of(context).textTheme.labelLarge,
                  ),
                ],
              );
            },
            separatorBuilder: (_, __) => SizedBox(height: 3),
            itemCount: tipList.length,
          ),
        ],
      ),
    );
  }
}
