sukeshkr1204

sukeshkr1204

Lv4

sukesh Kr

0 Followers
0 Following
3 Helped

ANSWERS

Published79

Subjects

Architecture2Project Management2History3Management1English2Anthropology4Astronomy6Business1Science2Electrical Engineering6Sociology1Communications7Ethics17Computer Science7Accounting4Calculus1Biology2Finance4Economics5Chemistry2

Flutter Program ver 3.7.6 and Android Studio Eel ver 2022.1.1 Patch 1

Problem w/Flatbutton see screenshot below how to create class for that one and where do I put it. Below screenshot is the full flutter program.

 

import 'package:flutter/material.dart';

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

class Todo extends StatelessWidget {
const Todo({super.key});

@override
Widget build(BuildContext context) {
return const MaterialApp(home: TodoList());
}
}

class TodoList extends StatefulWidget {
const TodoList({super.key});

@override
_TodoListState createState() => _TodoListState();
}

class _TodoListState extends State<TodoList> {
// save data
final List<String> _todoList = <String>[];
// text field
final TextEditingController _textFieldController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('To-Do List')),
body: ListView(children: _getItems()),
// add items to the to-do list
floatingActionButton: FloatingActionButton(
onPressed: () => _displayDialog(context),
tooltip: 'Add Item',
child: const Icon(Icons.add)),
);
}

void _addTodoItem(String title) {
// Wrapping it inside a set state will notify
// the app that the state has changed
setState(() {
_todoList.add(title);
});
_textFieldController.clear();
}

// this Generate list of item widgets
Widget _buildTodoItem(String title) {
return ListTile(title: Text(title));
}

// display a dialog for the user to enter items
Future<Future> _displayDialog(BuildContext context) async {
// alter the app state to show a dialog
return showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Add a task to your list'),
content: TextField(
controller: _textFieldController,
decoration: const InputDecoration(hintText: 'Enter task here'),
),
actions: <Widget>[
// add button
FlatButton(
child: const Text('ADD'),
onPressed: () {
Navigator.of(context).pop();
_addTodoItem(_textFieldController.text);
},
),
// Cancel button
FlatButton(
child: const Text('CANCEL'),
onPressed: () {
Navigator.of(context).pop();
},
)
],
);
}
);
}
// iterates through our todo list title
List<Widget> _getItems() {
final List<Widget> todoWidgets = <Widget>[];
for (String title in _todoList) {
todoWidgets.add(_buildTodoItem(title));
}
return todoWidgets;
}
}
Answer: Flutter: Create FlatButton Class [email protected] Flutter Progra...
Answer: To formulate the Linear Programming Problem (LPP) for this manufacturi...
Answer: To formulate the linear programming problem, we need to define the dec...
Answer: Introduction: The selected organization for this case study is Apple I...
Answer: Yes
Answer: Yes
Answer: The pH of a 0.0333 M solution of nitric acid (HNO3) can be calculated ...
Answer: The statement "If we do things right, there is nothing to fix" is a co...
Answer: Sulfur dioxide (SO2) is a molecular compound composed of two sulfur at...
Answer: To calculate the net present value (NPV) of the contract for Stephen C...
Answer: The statement "If we do things right, there is nothing to fix" aligns ...
Answer: Before 1660, bound labor was different from what developed into slaver...
Answer: For example, some customs that were common in the past but may seem st...
Answer: In Islamic economics, government debt is viewed differently than in co...
Answer: It can be argued that the lives of teenagers today are more difficult ...
Answer: Parables are an effective way of teaching because they use vivid, conc...
Answer: An ethical dilemma is a situation in which a person is faced with two ...
Answer: In this scenario, the best course of action would be to follow the eth...
Answer: option d
Answer: C. less than 1%
Answer: Corporate governance refers to the system of rules, practices, and pro...
Answer: The four sources of Christian ethics are: Scripture: This refers to th...
Answer: ⚪ prayer of the community ⚪ prayer of Thanksgiving ⚪ going out into th...
Answer: Inductive Deductive Inductive Deductive Deductive Deductive Inductive
Answer: God is the central figure in the Christian faith, and is described as ...
Answer:C. 4 seasons.
Answer: However, it's a commonly held belief that the cultural and historical ...
Answer: Values education is important because it helps individuals develop a s...
Answer: Socio-linguistic characteristics refer to the relationship between lan...
Answer: b) In building a bookcase one she should use nails, not scotch tape
Answer: Premises: David took the money from petty cash despite having plenty o...
Answer: Cyberethics is the field of ethics that studies the moral and ethical ...
Answer: i) Simplifying the Boolean expression: The Boolean expression can be s...
Answer: To calculate the total output power of the AM transmitter, we first ne...
Answer: A timing diagram of a store instruction is a graphical representation ...
Answer: The Energy Conservation Act, 2001 and the Electricity Act, 2003 are tw...
Answer: i) Alternating current (a.c) is used in preference to direct current (...
Answer: To determine the amount of total depreciation (including $179 expense)...
Answer: 8-Phase Shift Keying (8-PSK) is a digital modulation scheme that uses ...
Answer: Ang pera ay isang mahalagang sangkap sa ating pamumuhay. Ang bana ay i...

Weekly leaderboard

Start filling in the gaps now
Log in