darioielardi / flutter_speed_dial

Flutter plugin to implement a Material Design Speed Dial
https://pub.dev/packages/flutter_speed_dial
MIT License
410 stars 177 forks source link

Icons not showing and being replaced with random Icons #311

Closed BrendanBasson4 closed 1 year ago

BrendanBasson4 commented 1 year ago

The speed dial doesn't show my icons and some have been replaced with random Icons. When I replace my Icons with other Icons they render correctly but this can be hit or miss and some icons follow the same behaviour.

Speed Dial

SpeedDial(
  backgroundColor: theme.getPrimary(),
  activeBackgroundColor: theme.getPrimary(),
  icon: Icons.edit_calendar_sharp,
  activeIcon: Icons.close,
  spacing: 3,
  renderOverlay: true,
  overlayOpacity: 0.7,
  overlayColor: Colors.grey,
  openCloseDial: isDialOpen,
  childrenButtonSize: const Size(56, 56),
  onOpen: () {
    setState(() {
      isDialOpen.value = true;
    });
  },
  onClose: () {
    setState(() {
      isDialOpen.value = false;
    });
  },
)

Children

children: [
    SpeedDialChild(
      backgroundColor: theme.getSuccess(),
      child: Icon(Icons.edit_calendar, color: theme.getOnPrimary()),
      label: 'Schedule Appointment',
      labelStyle: const TextStyle(fontSize: 14.0),
      onTap: () {
        setState(() {
          isDialOpen.value = false;
        });
        Future.delayed(const Duration(milliseconds: 500), () {
          Navigator.push(
            context,
            PageRouteBuilder(
              pageBuilder: (context, animation, secondaryAnimation) => AppointmentsCreateScreen(selectedDate: _selectedDay!),
              transitionDuration: Duration.zero,
              reverseTransitionDuration: Duration.zero,
              settings: RouteSettings(name: RouteHelper.appointmentsCreate),
            ),
          ).then((value) {
            if (value ?? false) {
              refresh();
            }
          });
        });
      },
    ),
    SpeedDialChild(
      backgroundColor: theme.getSecondary(),
      foregroundColor: theme.getOnSecondary(),
      child: const Center(
        child: Icon(
          Icons.calendar_month,
        ),
      ),
      label: 'Schedule Multiple Appointments',
      labelStyle: const TextStyle(fontSize: 14.0),
      onTap: () {
        setState(() {
          isDialOpen.value = false;
        });
        Future.delayed(const Duration(milliseconds: 500), () {
          Navigator.push(
            context,
            PageRouteBuilder(
              pageBuilder: (context, animation, secondaryAnimation) => AppointmentCreateMultipleScreen(selectedDate: _selectedDay!),
              transitionDuration: Duration.zero,
              reverseTransitionDuration: Duration.zero,
              settings: RouteSettings(name: RouteHelper.appointmentsCreate),
            ),
          ).then((value) {
            if (value ?? false) {
              refresh();
            }
          });
        });
      },
    ),
  ],

Example 1

Screenshot_20230530_151632

Example 2

Screenshot_20230530_151634

BrendanBasson4 commented 1 year ago

Nevermind my flutter version was 2.10.0 which has problems with the icons switching to 2.10.3 fixed my issues.