import 'package:chat/configs/app_colors.dart';
import 'package:chat/routes/user_routes.dart';
import 'package:chat/views/home/widgets/action_item.dart';
import 'package:chat/views/user/index/widgets/user_top_bar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class UserPage extends StatefulWidget {
  const UserPage({Key? key}) : super(key: key);

  @override
  _UserPageState createState() => _UserPageState();
}

class _UserPageState extends State<UserPage> {
  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        body: Column(
          children: [
            const UserTopBar(),
            const Divider(
              height: 0,
              color: AppColors.border,
            ),
            const SizedBox(height: 8),
            const Divider(
              height: 0,
              color: AppColors.border,
            ),
            ActionItem(
              '服务',
              onTap: () {
                Get.toNamed(UserRoutes.serve);
              },
            ),
            const Divider(
              height: 0,
              color: AppColors.border,
            ),
            const SizedBox(height: 8),
            const Divider(
              height: 0,
              color: AppColors.border,
            ),
            ActionItem(
              '分享邀请',
              onTap: () {
                Get.toNamed(UserRoutes.share);
              },
            ),
            const Divider(
              height: 0,
              color: AppColors.border,
              indent: 16,
            ),
            ActionItem(
              '设置',
              onTap: () {
                Get.toNamed(UserRoutes.setting);
              },
            ),
            const Divider(
              height: 0,
              color: AppColors.border,
            ),
          ],
        ),
      ),
    );
  }
}
