date_cupertino_bottom_sheet_picker 0.0.2
date_cupertino_bottom_sheet_picker: ^0.0.2 copied to clipboard
This is a date package in the form of Cupertino and you can set the age limit of your users.
example/lib/main.dart
import 'package:date_cupertino_bottom_sheet_picker/date_cupertino_bottom_sheet_picker.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const Home(),
);
}
}
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
DateTime? selectedDate = DateTime(2010, 12, 5);
return Scaffold(
appBar: AppBar(
title: const Text('Home'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: DateCupertinoBottomSheetPicker(
width: 1.0,
firstDate: DateTime(1990),
lastDate: DateTime(2050),
selectedDate: selectedDate,
minAge: 18,
),
),
)
],
),
);
}
}