我收到这样的错误:
The current Dart SDK version is 2.17.5.
Because exampleapp requires SDK version >=2.18.0-271.2.beta <3.0.0, version solving failed.
pub get failed (1; Because keycehennemi requires SDK version >=2.18.0-271.2.beta <3.0.0, version solving failed.)
Run Code Online (Sandbox Code Playgroud)
pubspec.yaml:
environment:
sdk: '>=2.18.0-271.2.beta <3.0.0'
Run Code Online (Sandbox Code Playgroud)
正是颈部sdk?我不明白。在此先感谢您的帮助。
我正在尝试与 Dart Flutter 建立一个界面。我做了一个这样的界面:
我希望这些项目是可点击的。点击后,我将采取行动。我该怎么做才能单击项目?
代码:
body: Center(
child: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
),
itemCount: subjects.length,
itemBuilder: (BuildContext context, int index) {
return Container(
child: Card(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(subjects[index].subjectImage, fit: BoxFit.cover, height: 50, width: 50,),
SizedBox(height: 10,),
Text(subjects[index].subjectName, style: TextStyle(fontSize: 20),),
],
),
),
);
},
),
)
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Dart Flutter 进行 Google Auth 操作。
我编写了与我观看的视频中完全相同的代码。虽然它没有在视频中给出错误,但它给了我一个错误。
我的代码:
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:google_sign_in/google_sign_in.dart';
class GoogleSignInProvider extends ChangeNotifier {
final googleSignIn = GoogleSignIn();
bool _isSigningIn;
GoogleSignInProvider() {
_isSigningIn = false;
}
bool get isSigningIn => _isSigningIn;
set isSigningIn(bool isSigningIn) {
_isSigningIn = isSigningIn;
notifyListeners();
}
Future login() async {
isSigningIn = true;
final user = await googleSignIn.signIn();
if (user == null) {
isSigningIn = false;
return;
} else {
final googleAuth = await user.authentication;
final credential = GoogleAuthProvider.credential(
accessToken: …Run Code Online (Sandbox Code Playgroud) 我有一个这样的应用程序:
\n\n顶部的蓝色背景没有任何问题。但我想在该框下方显示配置文件编辑屏幕。我还将添加一个TextFormField来输入姓名信息。
现在我已经添加了Text显示屏幕。TextFormField一般情况下, where 部分会有Text。
我的代码如下:
\nclass settingsScreen extends StatefulWidget { \n @override\n State<settingsScreen> createState() => _settingsScreenState();\n}\nclass _settingsScreenState extends State<settingsScreen> {\n @override\n Widget build(BuildContext context) {\n return Scaffold(\n body: Column(\n children: [\n Container(\n decoration: BoxDecoration(\n color: Colors.blueAccent,\n borderRadius: BorderRadius.only(\n bottomLeft: Radius.circular(30),\n bottomRight: Radius.circular(30),\n ),\n ),\n height: 250,\n width: double.infinity,\n child: Column(\n children: [\n SizedBox(height: 35,),\n FutureBuilder<String>(\n future: getImage(),\n builder: (BuildContext context, AsyncSnapshot<String> snapshot) {\n if(snapshot.hasData) {\n return …Run Code Online (Sandbox Code Playgroud) 我正在使用 Flutter 开发移动应用程序。我TextFormField在我的应用程序中添加了一个这样的:
当我单击该图标时,该进程正在后端运行。但观点并没有改变。
我的代码:
TextFormField(
controller: _passwordController,
keyboardType: TextInputType.visiblePassword,
obscureText: SeePassword,
decoration: InputDecoration(
filled: true,
fillColor: Color.fromARGB(255, 232, 232, 232),
contentPadding: EdgeInsets.symmetric(vertical: 15),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20),
),
prefixIcon: Icon(Icons.lock, size: 20),
suffixIcon: GestureDetector(
child: SeePassword ? Icon(Icons.remove_red_eye) : Icon(Icons.highlight_off_sharp),
onTap: () {
SeePassword = !SeePassword;
print(SeePassword);
},
),
),
style: TextStyle(fontSize: 20, fontFamily: "Roboto Regular"),
),
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?