Neumorphic Design in flutter

How to achive Neumorphic design or UI in flutter

I am using this plugin which is flutter_neumorphic 3.1.0 but got these error

what am i doing wrong?

How can i actually achive Neumorphic design in flutter

    Launching lib\main.dart on sdk gphone x86 in debug mode...
lib\main.dart:1
/C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_neumorphic-3.1.0/lib/src/widget/button.dart:200:14: Error: 'AnimatedScale' is imported from both 'package:flutter/src/widgets/implicit_animations.dart' and 'package:flutter_neumorphic/src/widget/animation/animated_scale.dart'.
      child: AnimatedScale(
             ^^^^^^^^^^^^^
/C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_neumorphic-3.1.0/lib/src/widget/switch.dart:167:20: Error: 'AnimatedScale' is imported from both 'package:flutter/src/widgets/implicit_animations.dart' and 'package:flutter_neumorphic/src/widget/animation/animated_scale.dart'.
            child: AnimatedScale(
                   ^^^^^^^^^^^^^
3

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\Admin\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\Admin\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 23s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

I am sure that this happens because the AnimatedScale is called from different packages. how do i fix this?


There seems to be no issue with the libraries, The issue if of imports.

 'AnimatedScale' is imported from both 'package:flutter/src/widgets/implicit_animations.dart' and 'package:flutter_neumorphic/src/widget/animation/animated_scale.dart'

Here as you can see it shows AnimatedScale is Imported from both the libraries. Dart compiler wont know which AnimatedScale you want to use unless you specify it.

Simple Solution is

Step 1.

I am assuming you want to go for neumorphic While importing libraries use import 'package:flutter_neumorphic/src/widget/animation/animated_scale.dart' as nmAnimatedScale

Step 2.

Wherever you are using AnimatedScale replace it with nmAnimatedScale.AnimatedScale( ......)


Please try this on your pubspec

  flutter_neumorphic:
    git:
      url: https://github.com/tsvillain/Flutter-Neumorphic.git