cx_calendar_appbar 0.0.14 copy "cx_calendar_appbar: ^0.0.14" to clipboard
cx_calendar_appbar: ^0.0.14 copied to clipboard

Flutter package for custom AppBar with full calendar view with many new features!

example/lib/main.dart

import 'dart:math';

import 'package:cx_calendar_appbar/calendar_appbar.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Calendar AppBar Example App',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  DateTime? selectedDate;
  Random random = new Random();

  @override
  void initState() {
    setState(() {
      selectedDate = DateTime.now();
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CalendarAppBar(
        width: MediaQuery.of(context).size.width,
        onDateChanged: (value) => setState(() => selectedDate = value),
        lastDate: DateTime.now().add(Duration(days: 30)),
        firstDate: DateTime.now().subtract(Duration(days: 30)),
        initialDate: DateTime.now(),
        backButton: false,
        weekOfYearLabel: "KW",
        events: List.generate(
          100,
          (index) => DateTime.now().add(Duration(days: 30)).subtract(Duration(days: index * random.nextInt(5))),
        ),
      ),
      body: Center(child: Text(selectedDate.toString())),
    );
  }
}
2
likes
140
pub points
23%
popularity

Publisher

unverified uploader

Flutter package for custom AppBar with full calendar view with many new features!

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, intl, scrollable_positioned_list

More

Packages that depend on cx_calendar_appbar