johnjehu68

johnjehu68

Lv6

johnjehu68

0 Followers
0 Following
1 Helped

ANSWERS

Published139

Subjects

Law4English2Anthropology1Science1Mechanical Engineering1Algebra10Engineering1Computer Science2Accounting7Calculus9Mathematics28Physics28Economics1Chemistry44
Answer: The molecular ion peak at M/E = 218 in the mass spectrum of nootkatone...
Answer: The theoretical yield of propane in the reaction of 3 moles of propene...
Answer: The Intermediate Value Theorem states that if a function f is continuo...
Answer: Based on the given information, it can be deduced that Isomer A is an ...
Answer: One example of a C4H6 molecule with 1 sp, 2 sp2, and 1 sp3 hybridized ...
Answer: One example of a C4H6 molecule that contains 4 sp2 hybridized carbons ...
Answer: One example of a C4H6 structure with 1 sp, 2 sp2, and 1 sp3 hybridized...
Answer: a) Since the reaction goes to completion, the final concentrations of ...
Answer: Physics is the study of matter and energy and the interactions between...
Answer: Learning mathematics requires a strong foundation in concepts, consist...

Using the latest flutter version under Android Studio. 

Main dart page got numerous errors - See below link

The entire code (Which contained several pages)listed below in url-

 

The first one -

import 'package:flutter/material.dart';

What is wrong with that line above?
URL doesn't exist not sure why because it used to work before. For some reason it can't find the package

TextStyle(fontWeight: FontWeight.bold, fontSize: 13, color: Colors.black);
TextStyle not define (huh)? Was working before as well.
The rest of the required create class.
Are you guys able to resolve these error messages?

import 'package:flutter/material.dart';

import 'dart:core';

import 'package:final_project1/second.dart';
//test
void main() {
runApp(const App());
}

const text =
TextStyle(fontWeight: FontWeight.bold, fontSize: 13, color: Colors.black);
//for passing image to second screen

Image pic1 = Image.asset('images/burger.jpg');
Image pic2 = Image.asset('images/chicken.jpg');
Image pic3 = Image.asset('images/fries.jpg');

class App extends StatelessWidget {
const App({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark(),
debugShowCheckedModeBanner: false,
home: const MyApp(),
);
}
}

// ignore: non_constant_identifier_names
double? SmallPrize, MediumPrize, LargePrize;

// ignore: constant_identifier_names
enum OS { Burger, Chicken_Sandwich, French_Fries }

List<String> list = ['Burger', 'Chicken Sandwich', 'French Fries'];

OS? _os;
String? name;
Image pic = Image.asset('images/burger.jpg');
double? sb, mb, lb, ss, ms, ls, sf, mf, lf;
bool button = true;

class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);

@override
State<MyApp> createState() => _MyAppState();
}

String b = 'burger';
String c = 'Chicken Sandwich';
String f = 'French fries';

class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
toolbarHeight: 100,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
title: const Text(
'Menu',
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 30, color: Colors.black),
),
centerTitle: true,
backgroundColor: Colors.deepOrange,
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: SizedBox(
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 100, width: 100, child: ClipOval(child: pic2)),
const SizedBox(width: 20),
Expanded(
child: SizedBox(
child: RadioListTile<OS>(
dense: true,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: const BorderSide(
color: Colors.black, width: 3)),
contentPadding: const EdgeInsets.all(0),
tileColor: Colors.deepOrange,
title: Text(
list.elementAt(1),
style: text,
),
value: OS.Chicken_Sandwich,
groupValue: _os,
onChanged: (val) {
setState(() {
SmallPrize = 5.00;
MediumPrize = 7.00;
LargePrize = 9.00;
name = list.elementAt(1);
pic = pic2;
_os = val;
});
},
),
),
),
],
),
),
),
Expanded(
flex: 1,
child: SizedBox(
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 100, width: 100, child: ClipOval(child: pic1)),
const SizedBox(width: 20),
Expanded(
child: RadioListTile<OS>(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side:
const BorderSide(color: Colors.black, width: 3)),
contentPadding: const EdgeInsets.all(0),
title: Text(
list.first,
style: text,
),
value: OS.Burger,
groupValue: _os,
tileColor: Colors.deepOrange,
onChanged: (val) {
setState(() {
SmallPrize = 5.00;
MediumPrize = 7.00;
LargePrize = 9.00;
name = list.first;
pic = pic1;
_os = val;
});
},
),
),
],
),
),
),
Expanded(
child: SizedBox(
width: 300,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 100, width: 100, child: ClipOval(child: pic3)),
const SizedBox(width: 20),
Expanded(
child: SizedBox(
width: 400,
child: RadioListTile<OS>(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: const BorderSide(
color: Colors.black, width: 3)),
contentPadding: const EdgeInsets.all(0),
tileColor: Colors.deepOrange,
title: Text(
list.last,
style: text,
),
value: OS.French_Fries,
groupValue: _os,
onChanged: (val) {
setState(() {
SmallPrize = 2.50;
MediumPrize = 3.50;
LargePrize = 5.00;
name = list.last;
pic = pic3;
_os = val;
});
},
),
),
),
],
),
),
),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Second(
name_item: name.toString(),
pic: pic,
SmallPrize: SmallPrize,
MediumPrize: MediumPrize,
LargePrize: LargePrize,
),
),
);
},
child: Container(
width: double.infinity,
height: 100,
color: Colors.deepOrange,
child: const Center(
child: Text(
'Proceed',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
color: Colors.black),
),
),
),
),
],
),
);
}
}

Answer: Without seeing the specific error messages, it's difficult to know for...
Answer: Physics is the natural science that studies matter, energy, and the in...
Answer:a) The square matrix A with a rank(A) = 0 and nullity(A) = n is the zer...
Answer: To show that the binary operation on X/~ defined by [(a, b) [c, d) ~~ ...
Answer: To prove that +n and *n are well-defined binary operations on Zn, we n...
Answer:Yes, +n and *n are binary operations on the set Zn, where Z is the set ...

For flutter 3.3.2 fixed the return statement now having issues with the following lines - lib/main.dart(16,18): error G4127D1E8: The getter '_formkey' isn't defined for the class 'MyAppState'. [D:\form_widget5\build\windows\flutter\flutter_assemble.vcxproj]
lib/main.dart(28,23): error G4127D1E8: The getter 'loginData' isn't defined for the class 'MyAppState'. [D:\form_widget5\build\windows\flutter\flutter_assemble.vcxproj]
lib/main.dart(46,23): error G4127D1E8: The getter 'loginData' isn't defined for the class 'MyAppState'. [D:\form_widget5\build\windows\flutter\flutter_assemble.vcxproj]
lib/main.dart(56,27): error G4127D1E8: The getter '_formkey' isn't defined for the class 'MyAppState'. [D:\form_widget5\build\windows\flutter\flutter_assemble.vcxproj]
lib/main.dart(57,25): error G4127D1E8: The getter '_formkey' isn't defined for the class 'MyAppState'. [D:\form_widget5\build\windows\flutter\flutter_assemble.vcxproj]
lib/main.dart(59,52): error G4127D1E8: The getter 'loginData' isn't defined for the class 'MyAppState'. [D:\form_widget5\build\windows\flutter\flutter_assemble.vcxproj]
lib/main.dart(62,52): error G4127D1E8: The getter 'loginData' isn't defined for the class 'MyAppState'. [D:\form_widget5\build\windows\flutter\flutter_assemble.vcxproj]

Full code listed below

 

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

void main() {
runApp(const MyApp());
}

class MyAppState extends State<MyApp>{
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body : Container(
padding : const EdgeInsets.all(50.0),
child : Form(
key: _formkey,
child: Column(
children: [
TextFormField(
keyboardType: TextInputType.emailAddress,
validator: (String? inValue) {
if (inValue?.isEmpty?? true) {
return "Please enter username";
}
return null;
},
onSaved: (String? inValue) {
loginData.username = inValue!;
},
decoration: const InputDecoration(
hintText: "[email protected]",
labelText: "Username (eMail address)"
),
),
TextFormField(
obscureText: true,
validator: (String? inValue) {
if (inValue == null) {
return "Password cannot be null";
} else if (inValue.length < 10) {
return "Password must be >= 10 in length";
}
return null;
},
onSaved: (String? inValue) {
loginData.password = inValue!;
},
decoration: const InputDecoration(
hintText : "Password",
labelText : "Password"
),
),
ElevatedButton(
child : const Text("Log In!"),
onPressed: (){
if (_formkey.currentState!.validate()){
_formkey.currentState!.save();
if (kDebugMode) {
debugPrint ("Username: ${loginData.username}");
}
if (kDebugMode) {
debugPrint ("Password: ${loginData.password}");
}
}
},
),
]
),
),
),
),
);
}
}

class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
MyAppState createState() => MyAppState();
}

class LoginData {
String username = "";
String password = "";
}

Answer: It seems that the variables _formkey and loginData are not being defin...
Answer: To find the final velocity of the snowboarder after sliding down the i...
Answer: The net force acting on an object is equal to the force applied to the...
Answer: To calculate the density of silver, we first need to find the mass and...
Answer: The new water level in the cylinder will be 78.5 ml. The density of si...
Answer: The volume of the object is 2 ml. To figure this out, we can use the f...
Answer: The volume of Jack's object is 32 ml. To figure this out, we can use t...
Answer: In order to calculate the starting height of the owl, we can use the f...
Answer: We know that F varies directly with m and inversely with the square of...
Answer: h b. Name of the function x a. Domain of the function h(x) c. Output v...
Answer: The statement A is true. h(-1) = 2 - 4(-1) = 2 - (-4) = 2 + 4 = 6 The ...
y = -3x - 6 b. f(x) = -3x - 6 y = -5x - 3 a. f(x) = -5x - 3 y = 6x + 7 c. f(x)...
Answer: To prepare 750 mL of 0.5 M phosphate buffer, pH 6.7, you will need to ...
Answer: To make a buffer solution of pH 5.1, we need to add a small amount of ...
Answer: a. 0.5 M sodium acetate/0.5 M acetic acid: This solution is known as a...
Answer: To find the centroid of a lamina, we can use the formula: M = (1/A) * ...
Answer: The walls of the room have a total area of 13 ft x 18 ft x 4 (since th...
Answer: a) To calculate the density of the liquid using the given uncertainty ...
Answer: The hydronium ion concentration and pH after the addition of 0.25 mL o...
Answer: "one solution is a buffer" is not sufficient. The hydronium ion concen...
Answer: The hydronium ion concentration and pH after the addition of 0.25 mL o...
Answer: To calculate the concentrations of acetic acid and acetate in a buffer...
Answer:Yes, it is possible to convert wasted heat into useful energy or electr...
Answer:Yes, it is possible to convert wasted heat into useful energy or electr...

Weekly leaderboard

Start filling in the gaps now
Log in