Программируем под IOS
Anonymous
Мой код трепещения - ошибка, даже если код правильный
Сообщение
Anonymous » 06 май 2025, 20:03
Я написал свой код должным образом и установил все пакеты, но он ошибся для переменной.
Код: Выделить всё
import 'package:flutter/material.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Voice',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: SpeechScreen(),
);
}
}
class SpeechScreen extends StatefulWidget {
@override
_SpeechScreenState createState() => _SpeechScreenState();
}
class _SpeechScreenState extends State {
stt.SpeechToText _speech;
bool _isListening = false;
String _text = 'Press the button to start speaking';
double _confidence = 1.0;
@override
Widget build(BuildContext context) {
return Container();
}
}
Спасибо
Подробнее здесь:
https://stackoverflow.com/questions/695 ... e-is-right
1746551013
Anonymous
Я написал свой код должным образом и установил все пакеты, но он ошибся для переменной.[code]import 'package:flutter/material.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Voice', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: SpeechScreen(), ); } } class SpeechScreen extends StatefulWidget { @override _SpeechScreenState createState() => _SpeechScreenState(); } class _SpeechScreenState extends State { stt.SpeechToText _speech; bool _isListening = false; String _text = 'Press the button to start speaking'; double _confidence = 1.0; @override Widget build(BuildContext context) { return Container(); } } [/code] Спасибо Подробнее здесь: [url]https://stackoverflow.com/questions/69500045/my-flutter-code-is-erroring-even-though-the-code-is-right[/url]