FilledStacks / FilledStacks/testsweets

Error: Too many positional arguments: 1 allowed, but 2 found.

Open
#82 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
26
Forks
6
PR merge metrics
No merged PRs in 30d

Description

I just finished setting up TestSweet by following [the guide](https://testsweets-docs.web.app/guides/code-integration/)

But it's not letting me run the app in capture mode.

I keep getting this error:

```sh
Error (Xcode): ../../../../.pub-cache/hosted/pub.dev/testsweets-1.16.1/lib/src/ui/widget_capture/widget_capture_viewmodel.dart:287:10: Error: Too many positional arguments: 1 allowed, but 2 found.
```

My pubspec:
```yaml
name: app_stretch

# Prevent accidental publishing to pub.dev.
publish_to: "none"

version: 1.39.0+1210

environment:
flutter: 3.13.9
sdk: 3.1.5

dependencies:
app_links: 3.4.5
cached_network_image: 3.2.3
carousel_slider: 4.2.1
collection: 1.17.2
core:
path: ../core
country_picker: 2.0.21
data:
path: ../data
dio: 5.3.3
domain:
path: ../domain
either_dart: 0.4.0
features:
path: ../features
firebase_analytics: 10.4.2
firebase_core: 2.13.1
firebase_crashlytics: 3.3.2
firebase_messaging: 14.6.2
flex_color_scheme: 7.1.2
flutter:
sdk: flutter
flutter_branch_sdk: 7.0.1
flutter_dotenv: 5.1.0
flutter_local_notifications: 16.3.2
flutter_localizations:
sdk: flutter
flutter_pdfview: 1.3.1
flutter_platform_alert: 0.5.1
flutter_riverpod: 2.3.6
flutter_stripe: 9.5.0+1
flutter_svg: 2.0.7
flutter_xlider: 3.5.0
freezed_annotation: 2.4.1
get_storage: 2.1.1
go_router: 8.0.1
google_fonts: 6.1.0
image_cropper: 5.0.0
image_picker: 1.0.2
intl: 0.18.1
isar: 3.1.0+1
isar_flutter_libs: 3.1.0+1
json_annotation: 4.8.1
language_code: 0.3.0
latlong2: 0.9.0
localizations:
path: ../localizations
lottie: 2.4.0
path: 1.8.3
path_provider: 2.1.0
permission_handler: 10.4.3
pinput: 2.3.0
pull_to_refresh_notification: 3.1.0
rxdart: 0.27.7
shared_preferences: ^2.2.2
stack_trace: 1.11.0
testsweets: 1.16.1
timeago: 3.5.0
uikit:
path: ../uikit
url_launcher: 6.1.14
video_player: 2.7.1
webview_flutter: 4.2.2

dev_dependencies:
build_runner: 2.4.6
custom_lint: 0.4.0
flutter_gen: 5.3.2
flutter_gen_runner: 5.3.2
flutter_launcher_icons: 0.13.1
flutter_native_splash: 2.3.1
flutter_test:
sdk: flutter
freezed: 2.4.5
isar_generator: 3.1.0+1
json_serializable: 6.7.1

dependency_overrides:
http: 1.1.0
logger: 2.0.1

flutter_gen:
line_length: 120
integrations:
flutter_svg: true

flutter:
uses-material-design: true

assets:
- environment/
- google_fonts/
- assets/pngs/
- assets/images/

flutter_launcher_icons:
adaptive_icon_foreground: "assets/pngs/app_icon.png"
adaptive_icon_background: "#E7DEFF"
ios: true
remove_alpha_ios: true
image_path: "assets/pngs/app_icon.png"

flutter_native_splash:
color: "#fffbff"
image: "assets/pngs/launch_image.png"
android_12:
color: "#fffbff"
image: "assets/pngs/launch_image.png"

```

My MaterialApp widget:

```dart
return StreamBuilder(
stream: themeRepository.observeThemeMode(),
builder: (context, snapshot) {
final themeMode = snapshot.data;
final appTheme = themeMode?.toAppTheme(context) ?? AppTheme.of(context);

return MaterialApp.router(
restorationScopeId: 'app',
localizationsDelegates: const [
AppLocalizations.delegate,
CountryLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: AppLocalizations.supportedLocales,
onGenerateTitle: (context) => AppLocalizations.of(context).commonAppTitle,
theme: appTheme.theme,
routerConfig: router,
builder: (context, child) => TestSweetsOverlayView(
projectId: '{projectId}',
child: _AppObserver(
child: Builder(
builder: (context) => MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaleFactor: min(MediaQuery.of(context).textScaleFactor, 1.1),
),
child: ThemeProvider(
appTheme: appTheme,
child: _legacyIntilized
? Scaffold(
resizeToAvoidBottomInset: false,
key: _scaffoldKey,
body: child,
)
: const SizedBox(),
),
),
),
),
),
);
},
);
```

My main.dart:

```dart
final enableTestSweets = arguments.any((arg) => arg == 'enable_testsweets');
// Setup the TestSweets internal dependencies
await setupTestSweets(enabled: enableTestSweets);
```

I obviously ran `flutter pub get`

The flutter version for this project is: v3.13.3

No idea what to do to fix this...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.