import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

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

  @override
  State<ReportHistory> createState() => _ReportHistoryState();
}

class _ReportHistoryState extends State<ReportHistory> {
  bool isWork = true;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color(0xFFEDF0FF),
      appBar: AppBar(
        backgroundColor: Colors.white,
        title: Text(
          '已完成报告',
          style: TextStyle(fontSize: 14.r, color: Color(0xFF000000)),
        ),
        centerTitle: true,
        leading: IconButton(
          icon: Icon(Icons.arrow_back_ios, color: Colors.black),
          onPressed: () => Navigator.of(context).pop(),
        ),
      ),
      body: Column(
        children: [
          Container(
            width: MediaQuery.of(context).size.width * 0.8,
            height: 40.r,
            margin: EdgeInsets.only(
                top: 10.r, left: MediaQuery.of(context).size.width * 0.2 / 2),
            padding: EdgeInsets.all(2.r),
            decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.circular(8.r),
            ),
            child: Row(
              children: [
                Expanded(
                    child: InkWell(
                      onTap: (){
                        isWork = true;
                        setState(() {

                        });
                      },
                      child: Container(
                  decoration: BoxDecoration(
                      color: isWork ? Color(0xFF6988FD) : Colors.white,
                      borderRadius: BorderRadius.circular(8.r),
                  ),
                  child: Center(
                      child: Text(
                        '作业',
                        style: TextStyle(
                            fontSize: 14.r,
                            color: isWork ? Colors.white : Color(0xFF505E6E)),
                      ),
                  ),
                ),
                    )),
                Expanded(
                    child: InkWell(
                      onTap: (){
                        isWork = false;
                        setState(() {

                        });
                      },
                      child: Container(
                  decoration: BoxDecoration(
                      color: !isWork ? Color(0xFF6988FD) : Colors.white,
                      borderRadius: BorderRadius.circular(8.r),
                  ),
                  child: Center(
                      child: Text(
                        '考试',
                        style: TextStyle(
                            fontSize: 14.r,
                            color: !isWork ? Colors.white : Color(0xFF505E6E)),
                      ),
                  ),
                ),
                    )),
              ],
            ),
          )
        ],
      ),
    );
  }
}
