flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.64k stars 27.35k forks source link

Inner shadow for BoxShadow #52999

Closed AcnoSaga closed 2 months ago

AcnoSaga commented 4 years ago

Can we have an inset property on BoxShadow similar to CSS to have the effect of an inner shadow ?

shallx commented 4 years ago

Badly need this feature. I hope devs see this issue

GaryQian commented 3 years ago

This should be resolved by https://github.com/flutter/flutter/pull/84733

deepak-penaganti commented 3 years ago

This should be resolved by #84733

New PR #86504 should resolve this

reiko-dev commented 3 years ago

The behavior is still not working as desired. I've tried the code:

void main() async {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: const Demo(),
    );
  }
}

class Demo extends StatelessWidget {
  const Demo({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: Center(
        child: SizedBox(
          width: 200,
          height: 200,
          child: Container(
            decoration: BoxDecoration(
              boxShadow: [
                BoxShadow(
                  blurStyle: BlurStyle.inner,
                  color: Color(0xFF000000),
                  offset: Offset(0, 0),
                  blurRadius: 10,
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

The inner shadow is filling the entire container.

Flutter doctor -v [√] Flutter (Channel master, 2.6.0-12.0.pre.196, on Microsoft Windows [versão 10.0.19042.1237], locale pt-BR) • Flutter version 2.6.0-12.0.pre.196 at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 98120d19d3 (2 days ago), 2021-10-04 14:16:23 -0700 • Engine revision a36eac0a34 • Dart version 2.15.0 (build 2.15.0-177.0.dev) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at C:\Users\lukas\AppData\Local\Android\sdk • Platform android-30, build-tools 30.0.2 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.10.1) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community • Visual Studio Community 2019 version 16.10.31402.337 • Windows 10 SDK version 10.0.19041.0 [√] Android Studio (version 4.0) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) [√] VS Code (version 1.60.2) • VS Code at C:\Users\lukas\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.27.0 [√] Connected device (4 available) • SM G950F (mobile) • ce12171c638f281003 • android-arm64 • Android 9 (API 28) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [versão 10.0.19042.1237] • Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82 • Edge (web) • edge • web-javascript • Microsoft Edge 93.0.961.52 • No issues found!
AlexanderFarkas commented 2 years ago

Any updates on this?

victorsanni commented 2 months ago

This should be closed as a duplicate of https://github.com/flutter/flutter/issues/18636.

github-actions[bot] commented 2 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.