weekly_date_picker 1.4.2 copy "weekly_date_picker: ^1.4.2" to clipboard
weekly_date_picker: ^1.4.2 copied to clipboard

A weekly date picker where you can scroll between weeks and select a date.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:weekly_date_picker/weekly_date_picker.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Weekly Date Picker Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: const MyHomePage(title: 'Weekly Date Picker Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

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

class MyHomePageState extends State<MyHomePage> {
  DateTime _selectedDay = DateTime.now();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        children: [
          WeeklyDatePicker(
            selectedDay: _selectedDay,
            changeDay: (value) => setState(() {
              _selectedDay = value;
            }),
            enableWeeknumberText: false,
            weeknumberColor: const Color(0xFF57AF87),
            weeknumberTextColor: Colors.white,
            backgroundColor: const Color(0xFF1A1A1A),
            weekdayTextColor: const Color(0xFF8A8A8A),
            digitsColor: Colors.white,
            selectedDigitBackgroundColor: const Color(0xFF57AF87),
            weekdays: const ["Mo", "Tu", "We", "Th", "Fr"],
            daysInWeek: 5,
          ),
        ],
      ),
    );
  }
}
78
likes
160
points
845
downloads

Publisher

unverified uploader

Weekly Downloads

A weekly date picker where you can scroll between weeks and select a date.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, week_of_year

More

Packages that depend on weekly_date_picker