2022-08-26 09:56:44 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_date_time_picker/flutter_date_time_picker.dart';
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
runApp(const MyApp());
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
2022-09-01 16:09:20 +02:00
|
|
|
const MyApp({super.key});
|
2022-08-26 09:56:44 +02:00
|
|
|
|
|
|
|
// This widget is the root of your application.
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialApp(
|
|
|
|
title: 'Flutter Demo',
|
|
|
|
theme: ThemeData(
|
|
|
|
primarySwatch: Colors.blue,
|
|
|
|
),
|
2022-09-01 16:09:20 +02:00
|
|
|
home: Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: const Text('Roster'),
|
|
|
|
),
|
|
|
|
body: const DatePickerDemo(),
|
|
|
|
),
|
2022-08-26 09:56:44 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-01 16:09:20 +02:00
|
|
|
class DatePickerDemo extends StatelessWidget {
|
|
|
|
const DatePickerDemo({Key? key}) : super(key: key);
|
2022-08-26 09:56:44 +02:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-09-02 17:04:47 +02:00
|
|
|
return DateTimePicker(
|
2022-09-05 12:12:50 +02:00
|
|
|
dateTimePickerTheme: const DateTimePickerTheme(
|
|
|
|
markedIndicatorColor: Colors.red,
|
|
|
|
selectedTheme: DateBoxSelectedTheme(
|
|
|
|
Color(0x4BF44336),
|
|
|
|
TextStyle(
|
|
|
|
color: Colors.red,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
highlightTheme: DateBoxHighlightTheme(
|
|
|
|
Colors.red,
|
|
|
|
TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
markedDates: [DateTime(2022, 9, 6)],
|
2022-09-02 17:04:47 +02:00
|
|
|
);
|
2022-08-26 09:56:44 +02:00
|
|
|
}
|
|
|
|
}
|