How to Align Center Active Background Color on Date Number in package Syncfusion_flutter_datepicker version 20.3.61?

86 Views Asked by At

enter image description here

I want to make the background color of the date options when active to be centered. How can I do this?

Note: I am using SDK version 2.12 and syncfusion_flutter_datepicker version 20.3.61

enter image description here

Just like this.

Thanks...

1

There are 1 best solutions below

0
mashood touchworld On

You can use this to solve this issues


import 'package:flutter/material.dart';

import 'package:syncfusion_flutter_datepicker/datepicker.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: SfDateRangePicker(
            view: DateRangePickerView.month,
            monthCellStyle: DateRangePickerMonthCellStyle(
              activeDatesTextStyle: TextStyle(
                backgroundColor: Colors.blue,
                textAlign: TextAlign.center, // Align the text to the center
              ),
            ),
          ),
        ),
      ),
    );
  }
}