week_pick_button 0.0.6 copy "week_pick_button: ^0.0.6" to clipboard
week_pick_button: ^0.0.6 copied to clipboard

this is a week_picker You can select each year, and you can select any number of weeks, and the plugin will return the start time of the target week.

example/lib/main.dart

import 'package:flutter/material.dart';
import "package:week_pick_button/week_pick_button.dart";

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  DateTime now = DateTime.now();

  @override
  void initState() {
    super.initState();
    Future.delayed(const Duration(seconds: 3), () {
      now = DateTime(2023, 5, 11); // 更新now的值
      setState(() {});
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: WeekPickerButton(
            initialDate: now,
            firstDate: DateTime(now.year - 1, 5, 6),
            lastDate: DateTime(now.year + 1, 5, 6),
            onChanged: (value) {
              print(value);
            },
          ),
        ),
      ),
    );
  }
}
2
likes
140
points
50
downloads

Publisher

unverified uploader

Weekly Downloads

this is a week_picker You can select each year, and you can select any number of weeks, and the plugin will return the start time of the target week.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

dropdown_button2, flutter, flutter_web_plugins, jiffy

More

Packages that depend on week_pick_button