-
Notifications
You must be signed in to change notification settings - Fork 28
syncfusion_flutter_calendar not working event #5770
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
Comments
Hi there! |
I already mentiond all detail please check those |
the project id |
Hi again! |
But how can i find bug report code already shared all detail which is you required |
when i generrate the get bug report code in flutterflow that time its show below error how can i generated the bug report code Failure to copy to clipboard: PlatformException(copy_fail, Clipboard.setData failed, null, null) |
IT4si/Ll7Y91j7xa+KXxbcFR/TwROWJ7U780scpCbw4bIYj2P4lzY876P1NCOMu4TWxIPWCcp14Jp9rNuM71Lvc6YBeVGq56+bV+Txf/cHG5Wq2TF7iWYH99L99QG2qa5JizhhZ/JrdZdVoO2meMG9y/ShDrNrrWIUQ8Sq/LZO4= this is the bug report code |
Hi again! That said, I’ve reviewed your project and noticed a warning in your custom widget, which could be the cause of the issue. Try using a compatible version and see if that helps. Best regards |
i have removed this libraries which is version issue but still faced same issue |
the issue was on particular event not shown on calendar actually only calendar is show but event is not showing |
Hello again! |
Can we access your project?
Current Behavior
I have used syncfusion_flutter_calendar: ^29.1.38 in flutterflow but when i run the website in Google Chrome or any other browser, it gives an error. Actually, same code will work in vs code using web I have attached the error and Code screenshot
Actually calender work but event is not show i have attached screenshot of crome using inspect element
Errro - main.dart.js?ajTkjdLh8zt8bBuEHGgw:4481 Uncaught Error: Unable to load asset: "packages/timezone/data/latest_all.tzf", GET https://preview.flutterflow.app/magic-c-r-m-etxxf2/ajTkjdLh8zt8bBuEHGgw/assets/packages/timezone/data/latest_all.tzf 404 (Not Found)
// Automatic FlutterFlow imports import '/backend/schema/structs/index.dart'; import '/backend/supabase/supabase.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/custom_code/widgets/index.dart'; // Imports other custom widgets import '/custom_code/actions/index.dart'; // Imports custom actions import '/flutter_flow/custom_functions.dart'; // Imports custom functions import 'package:flutter/material.dart'; // Begin custom widget code // DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'package:syncfusion_flutter_calendar/calendar.dart'; import 'dart:math'; import 'package:flutter/services.dart' show rootBundle; import 'package:timezone/timezone.dart' as tz; import 'package:http/http.dart' as http;
class CustomCalendar extends StatefulWidget { const CustomCalendar({ super.key, this.width, this.height, required this.appoitmentList, });
final double? width; final double? height; final List appoitmentList;
@OverRide State createState() => _CustomCalendarState(); }
class _CustomCalendarState extends State { List _getDataSource() { final List meetings = [];
}
void dragStart(AppointmentDragStartDetails appointmentDragStartDetails) { dynamic appointment = appointmentDragStartDetails.appointment; CalendarResource? resource = appointmentDragStartDetails.resource; }
void dragUpdate(AppointmentDragUpdateDetails appointmentDragUpdateDetails) { dynamic appointment = appointmentDragUpdateDetails.appointment; DateTime? draggingTime = appointmentDragUpdateDetails.draggingTime; Offset? draggingOffset = appointmentDragUpdateDetails.draggingPosition; CalendarResource? sourceResource = appointmentDragUpdateDetails.sourceResource; CalendarResource? targetResource = appointmentDragUpdateDetails.targetResource; }
void dragEnd(AppointmentDragEndDetails appointmentDragEndDetails) { Meeting appointments = appointmentDragEndDetails.appointment as Meeting; dynamic appointment = appointmentDragEndDetails.appointment!; CalendarResource? sourceResource = appointmentDragEndDetails.sourceResource; CalendarResource? targetResource = appointmentDragEndDetails.targetResource; DateTime? droppingTime = appointmentDragEndDetails.droppingTime; }
// Future _initializeTimeZone() async { // try { // // Replace with your Supabase Storage public URL // const String timezoneUrl = // 'https://bnlijccqpoyjgvmnhssa.supabase.co/storage/v1/object/public/Documents//latest_all.tzf'; // final response = await http.get(Uri.parse(timezoneUrl)); // if (response.statusCode == 200) { // final tzData = response.bodyBytes; // tz.initializeDatabase(tzData); // print('Timezone initialized successfully'); // } else { // print('Failed to fetch timezone data: ${response.statusCode}'); // } // } catch (e) { // print('Error initializing timezone: $e'); // } // }
@OverRide void initState() { // _initializeTimeZone(); super.initState(); }
@OverRide Widget build(BuildContext context) { return ClipRRect( borderRadius: BorderRadius.circular(20), // Aggiungi i bordi arrotondati child: Container( width: widget.width, height: widget.height, child: SfCalendar( view: CalendarView.week, allowDragAndDrop: true, onDragStart: dragStart, onDragUpdate: dragUpdate, onDragEnd: dragEnd, monthViewSettings: MonthViewSettings( appointmentDisplayMode: MonthAppointmentDisplayMode.appointment), backgroundColor: Colors.white, dataSource: MeetingDataSource(_getDataSource()), headerStyle: const CalendarHeaderStyle(backgroundColor: Colors.white), weekNumberStyle: const WeekNumberStyle( textStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xff151515))), resourceViewSettings: const ResourceViewSettings( displayNameTextStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xff151515))), showWeekNumber: false, cellBorderColor: const Color(0xffE8E8E8), ), ), ); }
Color getRandomColor() { final Random random = Random(); return Color.fromARGB( 255, // Alpha value (fully opaque) random.nextInt(256), // Red value random.nextInt(256), // Green value random.nextInt(256), // Blue value ); } }
class MeetingDataSource extends CalendarDataSource { MeetingDataSource(List source) { appointments = source; }
@OverRide DateTime getStartTime(int index) { return appointments![index].from; }
@OverRide DateTime getEndTime(int index) { return appointments![index].to; }
@OverRide String getSubject(int index) { return appointments![index].eventName; }
@OverRide Color getColor(int index) { return appointments![index].background; }
@OverRide Object? convertAppointmentToObject( Object? customData, Appointment appointment) { return Meeting(appointment.subject, appointment.startTime, appointment.endTime, appointment.color); } }
class Meeting { Meeting(this.eventName, this.from, this.to, this.background);
String eventName; DateTime from; DateTime to; Color background; }
Expected Behavior
i want to show event using syncfusion_flutter_calendar 29.1.40 but its show asset error and in flutterflow asset how can i add "packages/timezone/data/latest_all.tzf".
Steps to Reproduce
Create custome code and run
Reproducible from Blank
Bug Report Code (Required)
https://preview.flutterflow.app/magic-c-r-m-etxxf2/q5j7tocijWS0rSdIQyjq/assets/packages/timezone/data/latest_all.tzf
Visual documentation
I have used syncfusion_flutter_calendar: ^29.1.38 in flutterflow but when i run the website in Google Chrome or any other browser, it gives an error. Actually, same code will work in vs code using web I have attached the error and Code screenshot
Actually calender work but event is not show i have attached screenshot of crome using inspect element
Errro - main.dart.js?ajTkjdLh8zt8bBuEHGgw:4481 Uncaught Error: Unable to load asset: "packages/timezone/data/latest_all.tzf", GET https://preview.flutterflow.app/magic-c-r-m-etxxf2/ajTkjdLh8zt8bBuEHGgw/assets/packages/timezone/data/latest_all.tzf 404 (Not Found)
Environment
Additional Information
The text was updated successfully, but these errors were encountered: