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

Using package example results in todays day name not being displayed #10

Closed
raLaaaa opened this issue May 28, 2020 · 2 comments
Closed
Labels
T: Fix Type: :bug: Bug Fixes

Comments

@raLaaaa
Copy link
Contributor

raLaaaa commented May 28, 2020

Hey thanks for your awesome library!

I tried to setup your example in my local project and everything works fine so far except for the fact that the name of the current day does not get displayed in the header. A screenshot will clarify things:

image

I basically just copied the code of your example folder. Is this a bug or am I doing something wrong? I also added some events but that doesn't change anything.

This is my controller:

    _controller = TimetableController(
      // A basic EventProvider containing a single event.
      eventProvider: provider,
      initialTimeRange: InitialTimeRange.range(
        startTime: LocalTime(8, 0, 0),
        endTime: LocalTime(20, 0, 0),
      ),
      initialDate: LocalDate.today(),
      visibleRange: VisibleRange.days(3),
      firstDayOfWeek: DayOfWeek.monday,
    );

This is my build:

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.white,
        appBar: AppBar(
          leading: IconButton(
            icon: Icon(Icons.arrow_back_ios, color: Colors.black),
            onPressed: () => Navigator.of(context).pop(),
          ),
          title: widget.args.roomId == null ? Text('TIMETABLE') : Text('TIMETABLE FOR ' + findRoomById(widget.args.roomId).name.toUpperCase()),
          actions: <Widget>[Padding(
              padding: EdgeInsets.only(top: 20.0),
              child: IconButton(
                icon: Icon(Icons.add),
                onPressed: () {

                },
                alignment: Alignment.center,
              ))],
          elevation: 0,
          centerTitle: true,
        ),
        body: Timetable<BasicEvent>(
          controller: _controller,
          eventBuilder: (event) => BasicEventWidget(event),
          allDayEventBuilder: (context, event, info) =>
              BasicAllDayEventWidget(event, info: info),
        ),
    );
  }

Any ideas what is going on? I might be doing something wrong. Maybe you can help me out here.

Cheers!


Currently using 0.2.1 of timetable.
Settings of my devices

Name: Pixel_API_R
CPU/ABI: Google Play Intel Atom (x86)
Path: C:\Users.android\avd\Pixel_API_R.avd
Target: google_apis_playstore [Google Play] (API level R)
Skin: pixel_silver
SD Card: 512M
fastboot.chosenSnapshotFile:
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: pixel
hw.lcd.width: 1080
image.androidVersion.codename: R
hw.initialOrientation: Portrait
image.androidVersion.api: 29
tag.id: google_apis_playstore
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Pixel API R
hw.gpu.mode: auto
hw.ramSize: 1536
PlayStore.enabled: true
fastboot.forceColdBoot: no
hw.cpu.ncore: 3
hw.keyboard: yes
hw.sensors.proximity: yes
hw.dPad: no
hw.lcd.height: 1920
vm.heapSize: 228
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.audioInput: yes
image.sysdir.1: system-images\android-R\google_apis_playstore\x86
showDeviceFrame: yes
hw.camera.back: virtualscene
AvdId: Pixel_API_R
hw.lcd.density: 420
hw.arc: false
hw.device.hash2: MD5:55acbc835978f326788ed66a5cd4c9a7
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google Play
runtime.network.latency: none
disk.dataPartition.size: 6442450944
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes

@raLaaaa raLaaaa added the T: Fix Type: :bug: Bug Fixes label May 28, 2020
@JonasWanke
Copy link
Owner

Thanks for the detailed description! As not only the current weekday indicator, but also the circle drawn around the current day of month isn't visible, I'd guess that your theme's primary color isn't visible on the background. You can resolve that by manually specifying a different primary color for timetable to use in it's theme (TimetableThemeData.primaryColor):

Timetable<BasicEvent>(
  controller: _controller,
  theme: TimetableThemeData(
    primaryColor: Colors.teal,
  ),
  // ...
)

Note: You can also specify those colors more specifically, see weekDayIndicatorDecoration & weekDayIndicatorTextStyle for the upper text containing the day of week and dateIndicatorDecoration & dateIndicatorTextStyle for the day of month displayed below in the documentation.

That should resolve your issue. If your theme's primary color isn't something like white or transparent, I'm not sure why this is happening though.

@raLaaaa
Copy link
Contributor Author

raLaaaa commented May 29, 2020

Thanks for your quick reply!
Ah, I didn't think about this one. Changing the primary color fixed it. '

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: Fix Type: :bug: Bug Fixes
Projects
None yet
Development

No branches or pull requests

2 participants