Skip to content

kundanm881/my_utils

Repository files navigation

My Utils

A My_Utils is make to help developers to fast and smooth coding experience with helping widget and method in flutter

Get Started

import 'package:kd_utils/kd_utils.dart';

TimeStamp

Usage.

  final DateTime date = timeStampToDateTime("1694160861");
  print(date); // 2023-09-08 13:44:21.000

  final weekDay = getWeekDay(1, short: true);
  print(weekDay); // Mon

Date Picker

Usage.

DatePickerView(
  currentDate: DateTime.now(),
  startDate: DateTime.now().subtract(Duration(days: 50)),
  endDate: DateTime.now().add(Duration(days: 50)),
  weekday: TextStyle(fontSize: 12, fontWeight: FontWeight.bold),
  decoration: BoxDecoration(borderRadius: BorderRadius.circular(10)),
  onDateClick: (selectedDate) {
    print(selectedDate);
  },
),

OTP View

Usage.

OTPView(
  otpCount: 5,
  style: OTPStyle(
      cursorColor: Colors.green,
      maxHeight: 60,
      inputBorder: OutlineInputBorder(
        borderRadius: BorderRadius.circular(8),
        borderSide: BorderSide(
          color: Colors.green,
          width: 3,
        ),
      ),
      isDense: true,
      space: 20),
  onSubmit: (otp) {
    log(otp.toString());
  },
  controller: TextEditingController(),
)

Extension methos

Widgets Extension

200.height,

10.width,

Context Extension

ThemeData themeData = context.theme;

EdgeInsets padding = context.viewPadding;

Size screenSize = context.screenSize;

double screenWidth = context.screenWidth;

double screenHeight = context.screenHeight;

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published