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": "视频陪学",
        "desc": "老师全程在线监督",
      },
      {
        "icon": RemixIcons.hand,
        "title": "举手提问",
        "desc": "实时互动解答疑惑",
      },
      {
        "icon": RemixIcons.camera_ai_line,
        "title": "拍照题目",
        "desc": "快速上传问题截图",
      },
      {
        "icon": RemixIcons.file_upload_line,
        "title": "文件共享",
        "desc": "支持PDF等多种格式",
      },
    ];
    return Container(
      margin: EdgeInsets.only(top: 15),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        spacing: 10,
        children: [
          Text("功能特色"),
          Row(
            spacing: 10,
            children: list.map((t) {
              final item = t as dynamic;
              return Expanded(
                child: GCard(
                  child: Column(
                    spacing: 5,
                    children: [
                      Container(
                        padding: EdgeInsets.all(10),
                        decoration: BoxDecoration(
                          color: Theme.of(context).primaryColor.withValues(alpha: 0.2),
                          borderRadius: BorderRadius.circular(10),
                        ),
                        child: Icon(
                          item['icon'],
                          color: Theme.of(context).primaryColor,
                        ),
                      ),
                      Text(item['title'],style: Theme.of(context).textTheme.bodySmall),
                      Text(
                        item['desc'],
                        style: Theme.of(context).textTheme.labelMedium,
                      ),
                    ],
                  ),
                ),
              );
            }).toList(),
          ),
        ],
      ),
    );
  }
}


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

  @override
  Widget build(BuildContext context) {
    final tipList = [
      "请保持摄像头开启，确保学习状态可见",
      "遇到问题可随时举手向老师提问",
      "建议准备好学习资料，提高学习效率",
      "自习期间请保持安静，避免打扰他人",
    ];
    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,
          ),
        ],
      ),
    );
  }
}