profscode_orbit_date_picker 1.0.0
profscode_orbit_date_picker: ^1.0.0 copied to clipboard
A space-themed orbit-style date picker for Flutter.
import 'package:flutter/material.dart';
import 'package:profscode_orbit_date_picker/profscode_orbit_date_picker.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: const Color(0xFF0E1320),
body: Builder(
builder: (context) => SafeArea(
child: Center(
child: Container(
padding: const EdgeInsets.all(24),
margin: const EdgeInsets.symmetric(horizontal: 24),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28),
gradient: const LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [Color(0xFF1B2236), Color(0xFF0E1320)],
),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.45),
blurRadius: 40,
offset: const Offset(0, 20),
),
],
border: Border.all(
color: Colors.white.withValues(alpha: 0.06),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// icon
Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: const LinearGradient(
colors: [Color(0xFFFFC107), Color(0xFFFF8F00)],
),
boxShadow: [
BoxShadow(
color: const Color(
0xFFFFC107,
).withValues(alpha: 0.4),
blurRadius: 20,
),
],
),
child: const Icon(
Icons.public,
color: Colors.black,
size: 32,
),
),
const SizedBox(height: 20),
const Text(
'Select Date',
style: TextStyle(
fontSize: 26,
fontWeight: FontWeight.w700,
color: Colors.white,
letterSpacing: 0.5,
),
),
const SizedBox(height: 8),
Text(
'Rotate the Earth to choose your day',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,
color: Colors.white.withValues(alpha: 0.65),
),
),
const SizedBox(height: 28),
GestureDetector(
onTap: () {
showDialog(
context: context,
builder: (_) => Dialog(
backgroundColor: const Color(0xFF0E1320),
insetPadding: const EdgeInsets.all(20),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(28),
),
child: Padding(
padding: const EdgeInsets.all(20),
child: profscodeOrbitDatePicker(
initialDate: DateTime.now(),
onDateChanged: (date) {},
),
),
),
);
},
child: Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(vertical: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18),
gradient: const LinearGradient(
colors: [Color(0xFF42A5F5), Color(0xFF1E88E5)],
),
boxShadow: [
BoxShadow(
color: const Color(
0xFF42A5F5,
).withValues(alpha: 0.35),
blurRadius: 24,
offset: const Offset(0, 10),
),
],
),
child: const Text(
'Open Date Picker',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Colors.white,
letterSpacing: 0.4,
),
),
),
),
],
),
),
),
),
),
),
);
}
}