FLUTTER ECOSYSTEM

mduccc/flutter_calendar_week

Flutter 日历周 UI 包

flutter_calendar_week 项目封面
Stars
81
Forks
49
最近推送(UTC)
2026年6月5日
项目状态
未归档
Minh Duc GitHub avatar
GITHUB User

Minh Duc ↗

Mobile Software Engineer

Ha Noi, Vietnam官方网站 ↗
语言DartPythonKotlinSwiftHTMLObjective-C

技术话题

此仓库发布的插件

使用的依赖

依赖清单 3 项
  • flutter{"sdk":"flutter"}
  • intl^0.19.0
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README
Flutter calendar week

Flutter calendar week UI package

Screenshot:
https://github.com/mduccc/flutter_calendar_week/blob/master/screenshot/example_app_1.png?raw=true
import 'package:flutter_calendar_week/flutter_calendar_week.dart';
CalendarWeek(
              controller: CalendarWeekController(),
              height: 100,
              showMonth: true,
              minDate: DateTime.now().add(
                Duration(days: -365),
              ),
              maxDate: DateTime.now().add(
                Duration(days: 365),
              ),
              
              onDatePressed: (DateTime datetime) {
                // Do something
              },
              onDateLongPressed: (DateTime datetime) {
               // Do something
              },
              onWeekChanged: () {
                // Do something
              },
              monthViewBuilder: (DateTime time) => Align(
                  alignment: FractionalOffset.center,
                  child: Container(
                      margin: const EdgeInsets.symmetric(vertical: 4),
                      child: Text(
                        DateFormat.yMMMM().format(time),
                        overflow: TextOverflow.ellipsis,
                        textAlign: TextAlign.center,
                        style: TextStyle(
                            color: Colors.blue, fontWeight: FontWeight.w600),
                      )),
                ),
              decorations: [
                DecorationItem(
                    decorationAlignment: FractionalOffset.bottomRight,
                    date: DateTime.now(),
                    decoration: Icon(
                      Icons.today,
                      color: Colors.blue,
                    )),
                DecorationItem(
                    date: DateTime.now().add(Duration(days: 3)),
                    decoration: Text(
                      'Holiday',
                      style: TextStyle(
                        color: Colors.brown,
                        fontWeight: FontWeight.w600,
                      ),
                    )),
              ],
            )