Elevation not working on flutter material










1















I want to do an app that looks like this Shrine App with that slice on the corner. I can make that slide but my app doesn't have that shadow.



I have my front layer wraped inside a material wideget with elevation like in the example MDC-104.



Here is my code to make that cut



import 'package:flutter/material.dart';

class ShapeLayer extends StatelessWidget
final Widget frontLayer;
final Widget backLayer = Container(
color: Colors.green,
);

ShapeLayer(Key key, this.frontLayer) : super(key: key);

@override
Widget build(BuildContext context)
return Stack(
children: <Widget>[
backLayer,
Material(
elevation: 60.0,
shape: BeveledRectangleBorder(
borderRadius: BorderRadius.only(topLeft: Radius.circular(46.0)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(child: frontLayer),
],
),
),
],
);




I use it like this:



return Scaffold(
appBar: appBar,
body: ShapeLayer(frontLayer: Container(//Some stuff here)


And it looks like this:
My App



As you can see it looks flat, with no elevation at all.



How can I fix this?



Thanks!



EDIT: as @SnakeyHips suggests, this is my app with elevation 16.0



elevation 16.0










share|improve this question




























    1















    I want to do an app that looks like this Shrine App with that slice on the corner. I can make that slide but my app doesn't have that shadow.



    I have my front layer wraped inside a material wideget with elevation like in the example MDC-104.



    Here is my code to make that cut



    import 'package:flutter/material.dart';

    class ShapeLayer extends StatelessWidget
    final Widget frontLayer;
    final Widget backLayer = Container(
    color: Colors.green,
    );

    ShapeLayer(Key key, this.frontLayer) : super(key: key);

    @override
    Widget build(BuildContext context)
    return Stack(
    children: <Widget>[
    backLayer,
    Material(
    elevation: 60.0,
    shape: BeveledRectangleBorder(
    borderRadius: BorderRadius.only(topLeft: Radius.circular(46.0)),
    ),
    child: Column(
    crossAxisAlignment: CrossAxisAlignment.stretch,
    children: <Widget>[
    Expanded(child: frontLayer),
    ],
    ),
    ),
    ],
    );




    I use it like this:



    return Scaffold(
    appBar: appBar,
    body: ShapeLayer(frontLayer: Container(//Some stuff here)


    And it looks like this:
    My App



    As you can see it looks flat, with no elevation at all.



    How can I fix this?



    Thanks!



    EDIT: as @SnakeyHips suggests, this is my app with elevation 16.0



    elevation 16.0










    share|improve this question


























      1












      1








      1








      I want to do an app that looks like this Shrine App with that slice on the corner. I can make that slide but my app doesn't have that shadow.



      I have my front layer wraped inside a material wideget with elevation like in the example MDC-104.



      Here is my code to make that cut



      import 'package:flutter/material.dart';

      class ShapeLayer extends StatelessWidget
      final Widget frontLayer;
      final Widget backLayer = Container(
      color: Colors.green,
      );

      ShapeLayer(Key key, this.frontLayer) : super(key: key);

      @override
      Widget build(BuildContext context)
      return Stack(
      children: <Widget>[
      backLayer,
      Material(
      elevation: 60.0,
      shape: BeveledRectangleBorder(
      borderRadius: BorderRadius.only(topLeft: Radius.circular(46.0)),
      ),
      child: Column(
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: <Widget>[
      Expanded(child: frontLayer),
      ],
      ),
      ),
      ],
      );




      I use it like this:



      return Scaffold(
      appBar: appBar,
      body: ShapeLayer(frontLayer: Container(//Some stuff here)


      And it looks like this:
      My App



      As you can see it looks flat, with no elevation at all.



      How can I fix this?



      Thanks!



      EDIT: as @SnakeyHips suggests, this is my app with elevation 16.0



      elevation 16.0










      share|improve this question
















      I want to do an app that looks like this Shrine App with that slice on the corner. I can make that slide but my app doesn't have that shadow.



      I have my front layer wraped inside a material wideget with elevation like in the example MDC-104.



      Here is my code to make that cut



      import 'package:flutter/material.dart';

      class ShapeLayer extends StatelessWidget
      final Widget frontLayer;
      final Widget backLayer = Container(
      color: Colors.green,
      );

      ShapeLayer(Key key, this.frontLayer) : super(key: key);

      @override
      Widget build(BuildContext context)
      return Stack(
      children: <Widget>[
      backLayer,
      Material(
      elevation: 60.0,
      shape: BeveledRectangleBorder(
      borderRadius: BorderRadius.only(topLeft: Radius.circular(46.0)),
      ),
      child: Column(
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: <Widget>[
      Expanded(child: frontLayer),
      ],
      ),
      ),
      ],
      );




      I use it like this:



      return Scaffold(
      appBar: appBar,
      body: ShapeLayer(frontLayer: Container(//Some stuff here)


      And it looks like this:
      My App



      As you can see it looks flat, with no elevation at all.



      How can I fix this?



      Thanks!



      EDIT: as @SnakeyHips suggests, this is my app with elevation 16.0



      elevation 16.0







      dart flutter material-design flutter-layout scaffold






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 14 '18 at 18:53







      Isaac

















      asked Nov 14 '18 at 11:32









      IsaacIsaac

      126114




      126114






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Change your elevation from 60.0 to 16.0 should do it:



          import 'package:flutter/material.dart';

          class ShapeLayer extends StatelessWidget
          final Widget frontLayer;
          final Widget backLayer = Container(
          color: Colors.green,
          );

          ShapeLayer(Key key, this.frontLayer) : super(key: key);

          @override
          Widget build(BuildContext context)
          return Stack(
          children: <Widget>[
          backLayer,
          Material(
          elevation: 16.0,
          shape: BeveledRectangleBorder(
          borderRadius: BorderRadius.only(topLeft: Radius.circular(46.0)),
          ),
          child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
          Expanded(child: frontLayer),
          ],
          ),
          ),
          ],
          );







          share|improve this answer























          • I tried, it's hard to tell, but I would say that it looks pretty much the same. See my edit

            – Isaac
            Nov 14 '18 at 18:55












          • It's there it's just that it's hard to tell with that shade of green. If you were to change the colour to something lighter it'll be more pronounced.

            – SnakeyHips
            Nov 15 '18 at 9:10












          • You're right, I see it if I put a light green background but it's something super subtle. Do you know of any way of making the shadow stronger?

            – Isaac
            Nov 15 '18 at 11:40











          • The amount of elevation determines how "strong" the shadow and is determined by Material Design guidelines so if any elevation value isn't getting the strength that you want then I'm not sure what else to suggest. The idea of elevation is to be a subtle shadow as shown in the Shrine app and anything darker than that would be against Material Design. As I said, a light colour choice for the back layer would be my recommendation.

            – SnakeyHips
            Nov 15 '18 at 13:12










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53299232%2felevation-not-working-on-flutter-material%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Change your elevation from 60.0 to 16.0 should do it:



          import 'package:flutter/material.dart';

          class ShapeLayer extends StatelessWidget
          final Widget frontLayer;
          final Widget backLayer = Container(
          color: Colors.green,
          );

          ShapeLayer(Key key, this.frontLayer) : super(key: key);

          @override
          Widget build(BuildContext context)
          return Stack(
          children: <Widget>[
          backLayer,
          Material(
          elevation: 16.0,
          shape: BeveledRectangleBorder(
          borderRadius: BorderRadius.only(topLeft: Radius.circular(46.0)),
          ),
          child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
          Expanded(child: frontLayer),
          ],
          ),
          ),
          ],
          );







          share|improve this answer























          • I tried, it's hard to tell, but I would say that it looks pretty much the same. See my edit

            – Isaac
            Nov 14 '18 at 18:55












          • It's there it's just that it's hard to tell with that shade of green. If you were to change the colour to something lighter it'll be more pronounced.

            – SnakeyHips
            Nov 15 '18 at 9:10












          • You're right, I see it if I put a light green background but it's something super subtle. Do you know of any way of making the shadow stronger?

            – Isaac
            Nov 15 '18 at 11:40











          • The amount of elevation determines how "strong" the shadow and is determined by Material Design guidelines so if any elevation value isn't getting the strength that you want then I'm not sure what else to suggest. The idea of elevation is to be a subtle shadow as shown in the Shrine app and anything darker than that would be against Material Design. As I said, a light colour choice for the back layer would be my recommendation.

            – SnakeyHips
            Nov 15 '18 at 13:12















          0














          Change your elevation from 60.0 to 16.0 should do it:



          import 'package:flutter/material.dart';

          class ShapeLayer extends StatelessWidget
          final Widget frontLayer;
          final Widget backLayer = Container(
          color: Colors.green,
          );

          ShapeLayer(Key key, this.frontLayer) : super(key: key);

          @override
          Widget build(BuildContext context)
          return Stack(
          children: <Widget>[
          backLayer,
          Material(
          elevation: 16.0,
          shape: BeveledRectangleBorder(
          borderRadius: BorderRadius.only(topLeft: Radius.circular(46.0)),
          ),
          child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
          Expanded(child: frontLayer),
          ],
          ),
          ),
          ],
          );







          share|improve this answer























          • I tried, it's hard to tell, but I would say that it looks pretty much the same. See my edit

            – Isaac
            Nov 14 '18 at 18:55












          • It's there it's just that it's hard to tell with that shade of green. If you were to change the colour to something lighter it'll be more pronounced.

            – SnakeyHips
            Nov 15 '18 at 9:10












          • You're right, I see it if I put a light green background but it's something super subtle. Do you know of any way of making the shadow stronger?

            – Isaac
            Nov 15 '18 at 11:40











          • The amount of elevation determines how "strong" the shadow and is determined by Material Design guidelines so if any elevation value isn't getting the strength that you want then I'm not sure what else to suggest. The idea of elevation is to be a subtle shadow as shown in the Shrine app and anything darker than that would be against Material Design. As I said, a light colour choice for the back layer would be my recommendation.

            – SnakeyHips
            Nov 15 '18 at 13:12













          0












          0








          0







          Change your elevation from 60.0 to 16.0 should do it:



          import 'package:flutter/material.dart';

          class ShapeLayer extends StatelessWidget
          final Widget frontLayer;
          final Widget backLayer = Container(
          color: Colors.green,
          );

          ShapeLayer(Key key, this.frontLayer) : super(key: key);

          @override
          Widget build(BuildContext context)
          return Stack(
          children: <Widget>[
          backLayer,
          Material(
          elevation: 16.0,
          shape: BeveledRectangleBorder(
          borderRadius: BorderRadius.only(topLeft: Radius.circular(46.0)),
          ),
          child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
          Expanded(child: frontLayer),
          ],
          ),
          ),
          ],
          );







          share|improve this answer













          Change your elevation from 60.0 to 16.0 should do it:



          import 'package:flutter/material.dart';

          class ShapeLayer extends StatelessWidget
          final Widget frontLayer;
          final Widget backLayer = Container(
          color: Colors.green,
          );

          ShapeLayer(Key key, this.frontLayer) : super(key: key);

          @override
          Widget build(BuildContext context)
          return Stack(
          children: <Widget>[
          backLayer,
          Material(
          elevation: 16.0,
          shape: BeveledRectangleBorder(
          borderRadius: BorderRadius.only(topLeft: Radius.circular(46.0)),
          ),
          child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
          Expanded(child: frontLayer),
          ],
          ),
          ),
          ],
          );








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 14 '18 at 15:40









          SnakeyHipsSnakeyHips

          584113




          584113












          • I tried, it's hard to tell, but I would say that it looks pretty much the same. See my edit

            – Isaac
            Nov 14 '18 at 18:55












          • It's there it's just that it's hard to tell with that shade of green. If you were to change the colour to something lighter it'll be more pronounced.

            – SnakeyHips
            Nov 15 '18 at 9:10












          • You're right, I see it if I put a light green background but it's something super subtle. Do you know of any way of making the shadow stronger?

            – Isaac
            Nov 15 '18 at 11:40











          • The amount of elevation determines how "strong" the shadow and is determined by Material Design guidelines so if any elevation value isn't getting the strength that you want then I'm not sure what else to suggest. The idea of elevation is to be a subtle shadow as shown in the Shrine app and anything darker than that would be against Material Design. As I said, a light colour choice for the back layer would be my recommendation.

            – SnakeyHips
            Nov 15 '18 at 13:12

















          • I tried, it's hard to tell, but I would say that it looks pretty much the same. See my edit

            – Isaac
            Nov 14 '18 at 18:55












          • It's there it's just that it's hard to tell with that shade of green. If you were to change the colour to something lighter it'll be more pronounced.

            – SnakeyHips
            Nov 15 '18 at 9:10












          • You're right, I see it if I put a light green background but it's something super subtle. Do you know of any way of making the shadow stronger?

            – Isaac
            Nov 15 '18 at 11:40











          • The amount of elevation determines how "strong" the shadow and is determined by Material Design guidelines so if any elevation value isn't getting the strength that you want then I'm not sure what else to suggest. The idea of elevation is to be a subtle shadow as shown in the Shrine app and anything darker than that would be against Material Design. As I said, a light colour choice for the back layer would be my recommendation.

            – SnakeyHips
            Nov 15 '18 at 13:12
















          I tried, it's hard to tell, but I would say that it looks pretty much the same. See my edit

          – Isaac
          Nov 14 '18 at 18:55






          I tried, it's hard to tell, but I would say that it looks pretty much the same. See my edit

          – Isaac
          Nov 14 '18 at 18:55














          It's there it's just that it's hard to tell with that shade of green. If you were to change the colour to something lighter it'll be more pronounced.

          – SnakeyHips
          Nov 15 '18 at 9:10






          It's there it's just that it's hard to tell with that shade of green. If you were to change the colour to something lighter it'll be more pronounced.

          – SnakeyHips
          Nov 15 '18 at 9:10














          You're right, I see it if I put a light green background but it's something super subtle. Do you know of any way of making the shadow stronger?

          – Isaac
          Nov 15 '18 at 11:40





          You're right, I see it if I put a light green background but it's something super subtle. Do you know of any way of making the shadow stronger?

          – Isaac
          Nov 15 '18 at 11:40













          The amount of elevation determines how "strong" the shadow and is determined by Material Design guidelines so if any elevation value isn't getting the strength that you want then I'm not sure what else to suggest. The idea of elevation is to be a subtle shadow as shown in the Shrine app and anything darker than that would be against Material Design. As I said, a light colour choice for the back layer would be my recommendation.

          – SnakeyHips
          Nov 15 '18 at 13:12





          The amount of elevation determines how "strong" the shadow and is determined by Material Design guidelines so if any elevation value isn't getting the strength that you want then I'm not sure what else to suggest. The idea of elevation is to be a subtle shadow as shown in the Shrine app and anything darker than that would be against Material Design. As I said, a light colour choice for the back layer would be my recommendation.

          – SnakeyHips
          Nov 15 '18 at 13:12

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53299232%2felevation-not-working-on-flutter-material%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Top Tejano songwriter Luis Silva dead of heart attack at 64

          ReactJS Fetched API data displays live - need Data displayed static

          政党