好了,所以我跑我的程序不导入火力核心,火力权威性和云公司的FireStore,我的代码运行得很好,但我与火力注册我的应用程序,它仍然运行良好,但只要我进口Firebase_auth,Firebase_core和cloud_Firestore...我得到以下错误
Note: C:\appflutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.7.0\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\appflutter\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.16.0\android\src\main\java\io\flutter\plugins\firebase\firestore\streamhandler\TransactionStreamHandler.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
D8: Cannot fit requested classes in a single dex file (# methods: 89543 > 65536)
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Run Code Online (Sandbox Code Playgroud)
请帮我。
import 'package:flutter/material.dart';
void main() {
runApp(Calculator());
}
class Calculator extends StatelessWidget {
final numpad_background_color = Color(0x212121);
final background_color = Colors.black;
final equal_button_background_color = Color(0xffbe00);
final textColor = Colors.white;
final operatorTextColor = Color(0xf3ba0e);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: appbar(context),
body: Stack(
children: [Container(height: MediaQuery.of(context).size.height * 0.37), numpad(context)],
)));
}
Widget appbar(BuildContext context) {
return AppBar(title: Text("Rechner", style: TextStyle(color: textColor, fontSize: 15)), backgroundColor: background_color, leading: Icon(Icons.history));
}
Widget numpad(BuildContext context) {
return Container(decoration: BoxDecoration(borderRadius: BorderRadius.circular(5), color: numpad_background_color), …Run Code Online (Sandbox Code Playgroud) 我正在使用image_picker 0.6.7+17库以便使用手机摄像头拍摄图像。
我使用的是 android 设备而不是 ios 设备。
似乎getImage没有定义该方法,我从文档中获取了这个确切的代码:
final picker = ImagePicker();
Future getImage() async {
final pickedFile = await picker.getImage(source: ImageSource.camera);
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
lib/pickers/image_picker.dart:17:37: Error: The method 'getImage' isn't defined for the class
'ImagePicker'.
- 'ImagePicker' is from 'package:chat_app/pickers/image_picker.dart'
('lib/pickers/image_picker.dart').
Try correcting the name to the name of an existing method, or defining a method named 'getImage'.
final pickedFile = await picker.getImage(source: ImageSource.camera);
^^^^^^^^
Run Code Online (Sandbox Code Playgroud)
到目前为止我做了什么:
dependencies:
flutter:
sdk: flutter …Run Code Online (Sandbox Code Playgroud) 您好,我对 Flutter 和软件开发总体来说还很陌生。我似乎无法理解如何从一项活动导航到另一项活动。我真正想要的是,当我按下登录按钮时,它应该将我导航到新活动
void main() {
runApp(MaterialApp(
title: 'button navigation',
home: HomeActivity(),
));
}
class HomeActivity extends StatelessWidget{
gotoSecondActivity(BuildContext context){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondActivity()),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Home Screen'),
),
body: Center(
child: RaisedButton(
child: Text('Go To Second Screen'),
color: Colors.red,
textColor: Colors.white,
onPressed: () {
gotoSecondActivity(context);
},
),
),
);
}
}
class SecondActivity extends StatelessWidget {
goBack(BuildContext context){
Navigator.pop(context);
}
@override
Widget build(BuildContext context) {
return Scaffold( …Run Code Online (Sandbox Code Playgroud)