Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter - CupertinoActionSheet / CupertinoActionSheetAction background color different on-device than in simulator

Tags:

flutter

My Scaffold has a dark background color.

I'm using showCupertinoModalPopup, with the CupertinoActionSheet and using CupertinoActionSheetAction as the children.

In the simulator the actionsheet looks like this:

photo.

When I run the app on my actual iphone, it looks like this:

photo

The actionsheet items look correct in the sim. Very white in appearance.

On-device though, are way more transparent on-device and therefore are harder to see.

Both CupertinoActionSheet and CupertinoActionSheetAction do not have color or transparency level properties

Any ideas on what's going on here?


Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.11.7, on Mac OS X 10.13.6 17G65, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] VS Code (version 1.29.0)
[✓] Connected device (3 available)
like image 931
aaronfg Avatar asked Nov 23 '18 21:11

aaronfg


1 Answers

return   showCupertinoModalPopup(
  context: context,
  builder: (BuildContext context) => CupertinoActionSheet(
    actions: <Widget>[
      Container(
        color: Colors.white,
        child: CupertinoActionSheetAction(
          onPressed: () {},
          child: const Text(
            'Made this my title',
          ),
        ),
      ),
      Container(
        color: Colors.white,
        child: CupertinoActionSheetAction(
          child: const Text(
            'next button',
          ),
          onPressed: () {},
        ),
      ),
      Container(
        color: Colors.white,
        child: CupertinoActionSheetAction(
          child: const Text(
            'next action',
          ),
          onPressed: () {},
        ),
      ),
    ],
    cancelButton: CupertinoActionSheetAction(
      child: const Text(
        'Cancel',
      ),
      isDefaultAction: true,
      onPressed: () {
        Navigator.pop(context);
      },
    ),
  ),
);
like image 130
Teajayy007 Avatar answered Oct 04 '22 21:10

Teajayy007