【发布时间】:2021-12-07 17:41:30
【问题描述】:
我正在 YouTube 上观看有关 Flutter 的教程。我来到了 Firebase 部分。但是,我在这部分遇到了错误。即使我输入相同的内容,我也会收到错误消息。我想我遇到了这样的错误,因为 Flutter 语言有更新。很抱歉我的英语不好。提前感谢您对我的帮助。
错误图片:
main.dart
import 'package:firebasedenemem/singup_screen.dart';
import 'package:flutter/material.dart';
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 Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const SignupScreen());
}
}
signup_screen.dart
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'dart:io';
class SignupScreen extends StatefulWidget {
const SignupScreen({Key? key}) : super(key: key);
@override
_SignupScreenState createState() => _SignupScreenState();
}
class _SignupScreenState extends State<SignupScreen> {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final picUrl = "";
File? _image;
final TextEditingController _nameController = TextEditingController();
final TextEditingController _lastnameController = TextEditingController();
final TextEditingController _emailController = TextEditingController();
FirebaseAuth auth = FirebaseAuth.instance;
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 30),
color: Colors.grey[800],
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Image(
image: AssetImage("assets/images/logo.png"),
width: 200,
height: 100,
),
Container(
margin: const EdgeInsets.only(top: 10),
decoration: BoxDecoration(
border: Border.all(color: Colors.white, width: 11),
color: Colors.white,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(122),
bottomLeft: Radius.circular(122),
)),
),
],
),
);
}
}
【问题讨论】:
-
嗯“了解如何在...处解决此问题”您是否错过了这部分错误?