We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Animate to page not working, it just scroll to the given date
To Reproduce Here is the code
class ScheduleScreen extends StatefulWidget { const ScheduleScreen({Key? key}) : super(key: key); @override _ScheduleScreenState createState() => _ScheduleScreenState(); } class _ScheduleScreenState extends State<ScheduleScreen> { DateTime _selectedDate = DateTime.now(); final DatePickerController _controller = DatePickerController(); @override void initState() { super.initState(); WidgetsBinding.instance!.addPostFrameCallback((timeStamp) { _controller.animateToDate(_selectedDate); }); } @override Widget build(BuildContext context) { final _theme = Theme.of(context); SizeConfiguration().init(context); return Scaffold( body: CustomScrollView( slivers: [ CustomSliverAppBar( title: "${DateFormat().add_MMMM().format(_selectedDate)} ${DateFormat().add_y().format(_selectedDate)}", children: [ Padding( padding: EdgeInsets.only( right: paddingX(5), top: paddingX(2), bottom: paddingX(2), ), child: ButtonPrimary( paddingVertical: 1.5, buttonColor: _theme.primaryColor, buttonTextColor: AppColors.white, buttonText: "Today", onPressed: () { _controller.animateToDate(DateTime.now()); setState(() { _selectedDate = DateTime.now(); }); }, ), ), ], ), SliverGap( height: paddingX(1), ), SliverToBoxAdapter( child: DatePicker( DateTime.now().subtract(const Duration(days: 365)), controller: _controller, initialSelectedDate: DateTime.now(), selectionColor: _theme.primaryColor, onDateChange: (date) { setState(() { _selectedDate = date; }); }, ), ), SliverGap( height: paddingX(1), ), ], ), ); } }
Expected behavior 21 October should be active date
Recording https://user-images.githubusercontent.com/77736118/138221572-91e3c9c0-19f3-434e-8358-ac71675ce777.mov
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Animate to page not working, it just scroll to the given date
To Reproduce
Here is the code
Expected behavior
21 October should be active date
Recording
https://user-images.githubusercontent.com/77736118/138221572-91e3c9c0-19f3-434e-8358-ac71675ce777.mov
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: