Home > Net >  Android Studio gives errors, how to solve?
Android Studio gives errors, how to solve?

Time:08-17

I want to build an app from a ready-made source, what is the problem?

This is logcat of my app:

enter image description here

Text:

>_menu/menu_screen_web.dart' ('lib/view/screens/menu/web_menu/menu_screen_web.dart').
Try correcting the name to the name of an existing method, or defining a method named 'BoxDecoration'.
                                decoration: BoxDecoration(shape: BoxShape.circle, border: Border.all(color: Colors.white, width: 4),
                                            ^^^^^^^^^^^^^
lib/view/screens/menu/web_menu/menu_screen_web.dart:130:66: Error: The getter 'BoxShape' isn't defined for the class 'MenuScreenWeb'.
 1. 'MenuScreenWeb' is from 'package:flutter_grocery/view/screens/menu/web_menu/menu_screen_web.dart' ('lib/view/screens/menu/web_menu/menu_screen_web.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'BoxShape'.
                                decoration: BoxDecoration(shape: BoxShape.circle, border: Border.all(color: Colors.white, width: 4),
                                                                 ^^^^^^^^
 2. List item

.....
.....
.....

lib/view/screens/home/web/category_page_view.dart:97:56: Error: The getter 'TextAlign' isn't defined for the class 'CategoryPageView'.
 - 'CategoryPageView' is from 'package:flutter_grocery/view/screens/home/web/category_page_view.dart' ('lib/view/screens/home/web/category_page_view.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'TextAlign'.
                                            textAlign: TextAlign.center,
                                                       ^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\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 12s
Exception: Gradle task assembleDebug failed with exit code 1

CodePudding user response:

I saw @required. Does this is little old? Because after null safety it use required only. Maybe downgrade Flutter version, or Dart version in pubspec file.

  • Related