'FILESYSTEMEXCEPTION , Invalid depfile in flutter
so i'm following a tutorial and trying to build an app with cards in it that has a quote , i've put the quotes in a list as objects from a class named quote , and made a function that returns a card , everything was working fine , but suddenly these weird errors started to face me this is the code
import 'dart:html';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:transparent_image/transparent_image.dart';
import 'quote.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
State<MyApp> createState() => Myappstate();
}
class Myappstate extends State<MyApp> {
List<quote> quotes = [
quote(text: 'be alive , not a survivor', author: 'mark'),
quote(
text: 'we are more humilated when we are afraid of being humilated',
author: 'tom'),
quote(text: 'shut up , and do the work ', author: 'isaak')
];
Widget Quotethecard(quote) {
return Container(
width: double.infinity,
child: Card(
margin: EdgeInsets.fromLTRB(16, 16, 16, 0),
child: Padding(
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(quote.text),
SizedBox(
height: 6,
),
Text(quote.author)
],
))));
}
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.grey,
appBar: AppBar(
title: Text('LIFE QUOTES'),
// centerTitle: true,
backgroundColor: Colors.red,
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: quotes.map((quote) => Quotethecard(quote)).toList(),
)));
}
}
and these are the errors :
Invalid depfile: C:\flutter projects\flutter app2\flutter_application_2\.dart_tool\flutter_build\fa97722b3b47c4f49ae962e1d74ff742\kernel_snapshot.d
: Error: Not found: 'dart:html'
lib/main.dart:1
import 'dart:html';
^
Unhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:dart%3Ahtml; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:34:7)
StandardFileSystem.entityForUri
#1 asFileUri (package:vm/kernel_front_end.dart:614:37)
#2 writeDepfile (package:vm/kernel_front_end.dart:754:21)
<asynchronous suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:571:9)
<asynchronous suspension>
#4 starter (package:flutter_frontend_server/server.dart:85:12)
Solution 1:[1]
You may try to delete import 'dart:html';
and run the project again.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | bgr |