Widget build(BuildContext context) { widthx = MediaQuery.of(context).size.width;

return MaterialApp(
  theme: ThemeData.light(),
  darkTheme: ThemeData.dark(),
  home: Container(
    child: Column(
      children: [
        getwindow(context),
        Expanded(
            child: Scaffold(
          bottomNavigationBar: Container(
            //圆角
            width: MediaQuery.of(context).size.width / 2,
            child: BottomSheetBar(
              controller: bottomSheetBarController,
              color: //透明
                  Colors.white,
              isDismissable: false,
              locked: false,
              height: Global.bottombarheight,
              expandedBuilder: (scrollController) {
                return MaterialApp(
                  debugShowCheckedModeBanner: false,
                  home: QRCode(),
                );
              },
              collapsed: SalomonBottomBar(
                currentIndex: 0,
                onTap: (i) {
                  // setState(() => _currentIndex = i);
                },
                items: [
                  /// Home
                  SalomonBottomBarItem(
                    icon: Icon(Icons.home),
                    title: Text("此处上滑显示图书馆二维码"),
                    selectedColor: Global.home_currentcolor,
                  ),
                ],
              ),
              body: Scaffold(
                appBar: CalendarAgenda(
                  controller: _calendarAgendaControllerAppBar,
                  initialDate: DateTime.now(),
                  appbar: true,
                  calendarLogo: getcalanderlogopngx(),
                  selectedDayLogo:
                      getlogopngx(), //使用ImageProvider<Object>加载IMage类型的logopic
                  backgroundColor: Global.home_currentcolor,
                  firstDate: Global.calendar_first_day,
                  lastDate: Global.calendar_last_day,
                  locale: 'zh_CN',
                  selectedDateColor: Colors.green.shade900,
                  fullCalendarScroll: FullCalendarScroll.vertical,
                  fullCalendarDay: WeekDay.long,
                  dateColor: Colors.white,
                  calendarEventColor: Global.home_currentcolor,
                  events: [DateTime.now().subtract(Duration(days: 0))],
                  onDateSelected: (date) {
                    hItems(date);
                  },
                ),
                body: GestureDetector(
                  onHorizontalDragEnd: (details) {
                    if (details.velocity.pixelsPerSecond.dx < 0) {
                      _calendarAgendaControllerAppBar.nextPage();
                    } else if (details.velocity.pixelsPerSecond.dx > 0) {
                      _calendarAgendaControllerAppBar.previousPage();
                    }
                  },
                  child: SideMenu(
                      background: Global.home_currentcolor,
                      key: _sideMenuKey,
                      menu: SingleChildScrollView(
                        padding: const EdgeInsets.symmetric(vertical: 50.0),
                        child: Column(
                          mainAxisAlignment: MainAxisAlignment.center,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Padding(
                              padding: const EdgeInsets.only(left: 16.0),
                              child: Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Lottie.asset('assets/score_detail.json'),
                                  SizedBox(height: 16.0),
                                  TextButton(
                                    onPressed: () =>
                                        Global().getrecently(context),
                                    child: Text(
                                      shijian(),
                                      style: TextStyle(color: Colors.white),
                                    ),
                                  ),
                                  SizedBox(height: 20.0),
                                ],
                              ),
                            ),
                            ListTile(
                              leading: const Icon(Icons.cached,
                                  size: 20.0, color: Colors.white),
                              title: Text(
                                '查看成绩',
                                style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 20,
                                    fontWeight: FontWeight.bold),
                              ),
                              onTap: () => Navigator.of(context).push(
                                MaterialPageRoute(
                                  builder: (context) => scorepage(),
                                ),
                              ),
                            ),
                            ListTile(
                                leading: const Icon(Icons.score_outlined,
                                    size: 20.0, color: Colors.white),
                                title: Text(
                                  'chatgpt(可连续对话)',
                                  style: TextStyle(
                                      color: Colors.white,
                                      fontSize: 20,
                                      fontWeight: FontWeight.bold),
                                ),
                                onTap: () {
                                  Navigator.of(context).pop(); //关闭侧边栏

                                  Navigator.push(
                                      context,
                                      MaterialPageRoute(
                                          builder: (context) => chat_gpt()));
                                }),
                            ListTile(
                              leading: const Icon(Icons.book_online,
                                  size: 20.0, color: Colors.white),
                              title: Text(
                                '一键评教',
                                style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 20,
                                    fontWeight: FontWeight.bold),
                              ),
                              onTap: () {
                                Navigator.of(context).pop(); //关闭侧边栏
                                Global()
                                    .No_perception_login()
                                    .then((value) => null);
                                Navigator.push(
                                    context,
                                    MaterialPageRoute(
                                        builder: (context) => pingjiao()));
                              },
                            ),
                            ListTile(
                              leading: const Icon(Icons.book_online,
                                  size: 20.0, color: Colors.white),
                              title: Text(
                                '请假历史',
                                style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 20,
                                    fontWeight: FontWeight.bold),
                              ),
                              onTap: () {
                                Navigator.of(context).pop(); //关闭侧边栏
                                Global()
                                    .No_perception_login()
                                    .then((value) => null);
                                Navigator.push(
                                    context,
                                    MaterialPageRoute(
                                        builder: (context) => qingjia()));
                              },
                            ),
                            ListTile(
                              leading: const Icon(Icons.colorize,
                                  size: 20.0, color: Colors.white),
                              title: Text(
                                '调个色',
                                style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 20,
                                    fontWeight: FontWeight.bold),
                              ),
                              onTap: () {
                                showDialog(
                                    context: context,
                                    builder: (context) {
                                      return MaterialApp(
                                          theme: ThemeData.light(),
                                          darkTheme: ThemeData.dark(),
                                          home: AlertDialog(
                                            title: Text('选择当前页颜色'),
                                            content: SingleChildScrollView(
                                              child: ColorPicker(
                                                pickerColor:
                                                    Global.home_currentcolor,
                                                onColorChanged: changeColor,
                                                colorPickerWidth: 300.0,
                                                pickerAreaHeightPercent: 0.7,
                                                enableAlpha: false,
                                                displayThumbColor: true,
                                                showLabel: true,
                                                paletteType: PaletteType.hsv,
                                                pickerAreaBorderRadius:
                                                    const BorderRadius.only(
                                                  topLeft:
                                                      const Radius.circular(
                                                          2.0),
                                                  topRight:
                                                      const Radius.circular(
                                                          2.0),
                                                ),
                                              ),
                                            ),
                                            actions: <Widget>[
                                              TextButton(
                                                child: const Text('确定'),
                                                onPressed: () async {
                                                  setState(() => Global
                                                          .home_currentcolor =
                                                      Global.home_pickcolor);
                                                  getApplicationDocumentsDirectory()
                                                      .then((value) {
                                                    File file = File(
                                                        value.path +
                                                            '/color.txt');
                                                    //判断文件是否存在
                                                    if (file.existsSync()) {
                                                      //存在则写入
                                                      file.writeAsString(Global
                                                          .home_currentcolor
                                                          .value
                                                          .toString());
                                                    } else {
                                                      //不存在则创建文件并写入
                                                      file.createSync();
                                                      file.writeAsString(Global
                                                          .home_currentcolor
                                                          .value
                                                          .toString());
                                                    }
                                                  });
                                                  Navigator.of(context).pop();
                                                },
                                              ),
                                            ],
                                          ));
                                    });
                              },
                            ),
                            ListTile(
                                leading: const Icon(Icons.score_outlined,
                                    size: 20.0, color: Colors.white),
                                title: Text(
                                  '查看学习通已批完的考试但未发布的成绩',
                                  style: TextStyle(
                                      color: Colors.white,
                                      fontSize
这个可以改写向左向右滑也切换日期吗 Widget buildBuildContext context widthx = MediaQueryofcontextsizewidth; return MaterialApp theme ThemeDatalight darkTheme ThemeDatadark home Container c

原文地址: https://www.cveoy.top/t/topic/fk7K 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录