Error while trying to load an asset: Flutter Web engine failed to fetch
"assets/packages/carbon/assets/svg/notification/info-lowcontrast.svg". HTTP request succeeded, but the server responded with HTTP
status 404.
βββ‘ EXCEPTION CAUGHT BY SVG ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The following assertion was thrown resolving a single-frame picture stream:
Unable to load asset: "packages/carbon/assets/svg/notification/info-lowcontrast.svg".
The asset does not exist or has empty data.
When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 288:49 throw_
packages/flutter/src/services/asset_bundle.dart 328:9 <fn>
dart-sdk/lib/async/zone.dart 1661:54 runUnary
dart-sdk/lib/async/future_impl.dart 147:18 handleValue
dart-sdk/lib/async/future_impl.dart 784:44 handleValueCallback
dart-sdk/lib/async/future_impl.dart 813:13 _propagateToListeners
dart-sdk/lib/async/future_impl.dart 584:5 [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 657:7 callback
dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 177:15 <fn>
Picture provider: ExactAssetPicture(name:
"packages/carbon/assets/svg/notification/info-lowcontrast.svg", bundle: null, colorFilter: null)
Picture key: AssetBundlePictureKey(bundle: PlatformAssetBundle#e8693(), name:
"packages/carbon/assets/svg/notification/info-lowcontrast.svg", colorFilter: null, theme:
SvgTheme(currentColor: Color(0xff000000), fontSize: 14, xHeight: 7))
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Error while trying to load an asset: Flutter Web engine failed to fetch
"assets/packages/carbon/assets/svg/notification/close-lowcontrast.svg". HTTP request succeeded, but the server responded with HTTP
status 404.
Error while trying to load an asset: Flutter Web engine failed to fetch
"assets/packages/carbon/assets/svg/notification/error-lowcontrast.svg". HTTP request succeeded, but the server responded with HTTP
status 404.
Error while trying to load an asset: Flutter Web engine failed to fetch
"assets/packages/carbon/assets/svg/notification/warning-lowcontrast.svg". HTTP request succeeded, but the server responded with
HTTP status 404.
Error while trying to load an asset: Flutter Web engine failed to fetch
"assets/packages/carbon/assets/svg/notification/success-lowcontrast.svg". HTTP request succeeded, but the server responded with
HTTP status 404.
Error while trying to load an asset: Flutter Web engine failed to fetch
"assets/packages/carbon/assets/svg/notification/info-highcontrast.svg". HTTP request succeeded, but the server responded with HTTP
status 404.
Error while trying to load an asset: Flutter Web engine failed to fetch
"assets/packages/carbon/assets/svg/notification/close-highcontrast.svg". HTTP request succeeded, but the server responded with HTTP
status 404.
Error while trying to load an asset: Flutter Web engine failed to fetch
"assets/packages/carbon/assets/svg/notification/error-highcontrast.svg". HTTP request succeeded, but the server responded with HTTP
status 404.
Error while trying to load an asset: Flutter Web engine failed to fetch
"assets/packages/carbon/assets/svg/notification/warning-highcontrast.svg". HTTP request succeeded, but the server responded with
HTTP status 404.
Error while trying to load an asset: Flutter Web engine failed to fetch
"assets/packages/carbon/assets/svg/notification/success-highcontrast.svg". HTTP request succeeded, but the server responded with
HTTP status 404.
Another exception was thrown: Unable to load asset: "packages/carbon/assets/svg/notification/close-lowcontrast.svg".
Another exception was thrown: Unable to load asset: "packages/carbon/assets/svg/notification/error-lowcontrast.svg".
Another exception was thrown: Unable to load asset: "packages/carbon/assets/svg/notification/warning-lowcontrast.svg".
Another exception was thrown: Unable to load asset: "packages/carbon/assets/svg/notification/success-lowcontrast.svg".
Another exception was thrown: Unable to load asset: "packages/carbon/assets/svg/notification/info-highcontrast.svg".
Another exception was thrown: Unable to load asset: "packages/carbon/assets/svg/notification/close-highcontrast.svg".
Another exception was thrown: Unable to load asset: "packages/carbon/assets/svg/notification/error-highcontrast.svg".
Another exception was thrown: Unable to load asset: "packages/carbon/assets/svg/notification/warning-highcontrast.svg".
The Flutter DevTools debugger and profiler on Chrome is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:45395/7_I9ZyM9hX4=
Another exception was thrown: Unable to load asset: "packages/carbon/assets/svg/notification/success-highcontrast.svg".
import 'package:flutter/material.dart';
import 'package:carbon_flutter/carbon.dart';
class CNotificationExample extends StatelessWidget {
const CNotificationExample({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: CColors.gray100,
body: SingleChildScrollView(
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 48),
CText(
data: 'Toast notification',
style: TextStyle(fontSize: 32),
),
const SizedBox(height: 24),
Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
children: [
CNotification.toast(
onCloseButtonTap: () {},
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
caption: CText(data: 'Time stamp [00:00:00]'),
),
const SizedBox(height: 8),
CNotification.toast(
onCloseButtonTap: () {},
kind: CNotificationKind.error,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
caption: CText(data: 'Time stamp [00:00:00]'),
),
const SizedBox(height: 8),
CNotification.toast(
onCloseButtonTap: () {},
kind: CNotificationKind.warning,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
caption: CText(data: 'Time stamp [00:00:00]'),
),
const SizedBox(height: 8),
CNotification.toast(
onCloseButtonTap: () {},
kind: CNotificationKind.success,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
caption: CText(data: 'Time stamp [00:00:00]'),
),
const SizedBox(height: 8),
],
),
const SizedBox(width: 16),
Column(
children: [
CNotification.toast(
onCloseButtonTap: () {},
contrast: CNotificationContrast.high,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
caption: CText(data: 'Time stamp [00:00:00]'),
),
const SizedBox(height: 8),
CNotification.toast(
onCloseButtonTap: () {},
contrast: CNotificationContrast.high,
kind: CNotificationKind.error,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
caption: CText(data: 'Time stamp [00:00:00]'),
),
const SizedBox(height: 8),
CNotification.toast(
onCloseButtonTap: () {},
contrast: CNotificationContrast.high,
kind: CNotificationKind.warning,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
caption: CText(data: 'Time stamp [00:00:00]'),
),
const SizedBox(height: 8),
CNotification.toast(
onCloseButtonTap: () {},
contrast: CNotificationContrast.high,
kind: CNotificationKind.success,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
caption: CText(data: 'Time stamp [00:00:00]'),
),
const SizedBox(height: 8),
],
),
],
),
const SizedBox(height: 24),
CText(
data: 'Inline notification',
style: TextStyle(fontSize: 32),
),
const SizedBox(height: 24),
SizedBox(
width: MediaQuery.of(context).size.width * 0.4,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CNotification.inline(
onCloseButtonTap: () {},
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
actions: [
CNotificationActionButton(
child: CText(data: 'Action'), onTap: () {}),
],
),
const SizedBox(height: 16),
CNotification.inline(
onCloseButtonTap: () {},
title: CText(data: 'Notification title'),
subtitle: CText(
data:
'Long text. Long text. Long text. Long text. Long text. Long text. Long text. Long text.'),
actions: [
CNotificationActionButton(
child: CText(data: 'Action'), onTap: () {}),
],
),
const SizedBox(height: 16),
CNotification.inline(
onCloseButtonTap: () {},
kind: CNotificationKind.error,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
actions: [
CNotificationActionButton(
child: CText(data: 'Action'), onTap: () {}),
],
),
const SizedBox(height: 16),
CNotification.inline(
onCloseButtonTap: () {},
kind: CNotificationKind.warning,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
actions: [
CNotificationActionButton(
child: CText(data: 'Action'), onTap: () {}),
],
),
const SizedBox(height: 16),
CNotification.inline(
onCloseButtonTap: () {},
kind: CNotificationKind.success,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
actions: [
CNotificationActionButton(
child: CText(data: 'Action'), onTap: () {}),
],
),
const SizedBox(height: 16),
//
CNotification.inline(
onCloseButtonTap: () {},
contrast: CNotificationContrast.high,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
actions: [
CNotificationActionButton(
child: CText(data: 'Action'), onTap: () {}),
],
),
const SizedBox(height: 16),
CNotification.inline(
onCloseButtonTap: () {},
kind: CNotificationKind.error,
contrast: CNotificationContrast.high,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
actions: [
CNotificationActionButton(
child: CText(data: 'Action'), onTap: () {}),
],
),
const SizedBox(height: 16),
CNotification.inline(
onCloseButtonTap: () {},
kind: CNotificationKind.warning,
contrast: CNotificationContrast.high,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
actions: [
CNotificationActionButton(
child: CText(data: 'Action'), onTap: () {}),
],
),
const SizedBox(height: 16),
CNotification.inline(
onCloseButtonTap: () {},
kind: CNotificationKind.success,
contrast: CNotificationContrast.high,
title: CText(data: 'Notification title'),
subtitle: CText(data: 'Subtitle text goes here.'),
actions: [
CNotificationActionButton(
child: CText(data: 'Action'), onTap: () {}),
],
),
const SizedBox(height: 16),
],
),
)
],
),
),
),
);
}
}
The SVG assets should load correctly, and no errors should be thrown.
Multiple errors are thrown, indicating that the SVG assets cannot be loaded, and the server responds with an HTTP status of 404.
If there are any known workarounds or if additional information is required, please let me know.