event_booking_timeline 0.0.3 copy "event_booking_timeline: ^0.0.3" to clipboard
event_booking_timeline: ^0.0.3 copied to clipboard

To display the events booked in a specific time of the day. The events which are booked or reserved are displayed in forms of colors. Callbacks are provided to get the selected event. The properties a [...]

example/main.dart

import 'package:flutter/material.dart';
import 'package:event_booking_timeline/event_booking_timeline.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  String text = "";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Container(
          color: Colors.grey[200],
          height: 200,
          width: 400,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              const SizedBox(
                height: 25,
                width: 200,
              ),
              SizedBox(
                  height: 50, width: 200, child: Text("Selected Time: $text")),
              const Icon(
                Icons.arrow_drop_down,
                size: 30,
              ),
              Expanded(
                child: EventBookingTimeline(
                  booked: [
                    Booking(startTime: "00:00", endTime: "01:00"),
                    Booking(startTime: "01:00", endTime: "02:00"),
                    Booking(startTime: "08:00", endTime: "09:00"),
                  ],
                  startTime: "00:00",
                  endTime: "24:00",
                  is12HourFormat: true,
                  moveToFirstAvailableTime: false,
                  numberOfSubdivision: 5,
                  widthOfSegment: 100,
                  widthOfTimeDivisionBar: 3,
                  availableColor: Colors.green,
                  bookedColor: Colors.red,
                  onTimeSelected: (String time) {
                    setState(
                      () {
                        text = time;
                      },
                    );
                  },
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
8
likes
0
pub points
60%
popularity

Publisher

unverified uploader

To display the events booked in a specific time of the day. The events which are booked or reserved are displayed in forms of colors. Callbacks are provided to get the selected event. The properties are customizable.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on event_booking_timeline