Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing Full Day Event does not work #179

Closed
JakeSeo opened this issue Feb 2, 2023 · 0 comments
Closed

Removing Full Day Event does not work #179

JakeSeo opened this issue Feb 2, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@JakeSeo
Copy link

JakeSeo commented Feb 2, 2023

Hi, Im trying to remove a full day event but it doesn't seem to work.
here's my dependency version:

  calendar_view: ^1.0.2

and my flutter version:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on macOS 13.1 22C65 darwin-arm, locale en-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.74.3)
[✓] Connected device (1 available)
[✓] HTTP Host Availability

I created this code to reproduce the issue. Please check on this and tell me if I'm doing something wrong.

This is the full code:

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Full Day Event Remove',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  EventController<Event> _eventController = EventController<Event>();

  @override
  void initState() {
    super.initState();
    Event sampleFullDayEvent = Event(id: 1, title: "Full Day Event");
    CalendarEventData<Event> sampleFullDayEventData = CalendarEventData<Event>(
      title: sampleFullDayEvent.title,
      date: DateTime(2023, 2, 2, 0, 0),
      startTime: DateTime(2023, 2, 2, 0, 0),
      endDate: DateTime(2023, 2, 4, 0, 0),
      endTime: DateTime(2023, 2, 4, 0, 0),
      event: sampleFullDayEvent,
    );
    Event sampleEvent = Event(id: 1, title: "Event");
    CalendarEventData<Event> sampleEventData = CalendarEventData<Event>(
      title: sampleEvent.title,
      date: DateTime(2023, 2, 3, 0, 0),
      startTime: DateTime(2023, 2, 3, 0, 0),
      endDate: DateTime(2023, 2, 3, 1, 0),
      endTime: DateTime(2023, 2, 3, 1, 0),
      event: sampleEvent,
    );
    _eventController.add(sampleFullDayEventData);
    _eventController.add(sampleEventData);
  }

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: MonthView(
        controller: _eventController,
        onEventTap: (event, date) {
          _eventController.remove(event);
        },
      ),
    );
  }
}

class Event {
  int id;
  String title;
  Event({required this.id, required this.title});
}
@faiyaz-shaikh faiyaz-shaikh added bug Something isn't working priority:1 Bug/Enhancement with highest priority. labels Feb 3, 2023
@PRBaraiya PRBaraiya removed the priority:1 Bug/Enhancement with highest priority. label Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants