I need help finishing this flutter code, please, please! I can provide more code details if needed I need the stock name

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

I need help finishing this flutter code, please, please! I can provide more code details if needed I need the stock name

Post by answerhappygod »

I need help finishing this flutter code, please, please! I can
provide more code details if needed
I Need Help Finishing This Flutter Code Please Please I Can Provide More Code Details If Needed I Need The Stock Name 1
I Need Help Finishing This Flutter Code Please Please I Can Provide More Code Details If Needed I Need The Stock Name 1 (80.24 KiB) Viewed 15 times
I need the stock name and price to display the value from API
after the user input the name of the code in the show dialog
box.
I did already fetch the API using Future getQuote
please let me know
thank you
contentPadding: Edgeinsets.all 5.0, content: TextField( decoration: Input Decoration (hintText: "Symbol"), onChanged: (String value) { _stockSymbol = value; }, ), // TextField actions: <Widget>[ TextButton( child: const Text ("Add Stock"), onPressed: () async { if (_stockSymbol.isNotEmpty) { print('User entered Symbol: $_stockSymbol'); try { //TODO: //Inside of this try, //get the stock data with stockService.getQuote //but remember you must use await, //then if it is not null, //dig out the symbol, companyName, and latestPrice, //then create a new object of //type Stock and add it to //the database by calling //_databaseService.insertStock, //then get all the stocks from //the database with //_databaseService.getAllStocksFromDb and //attach them to _stockList, //then print all stocks to the console and, //finally call setstate at the end. await _stockService.getQuote( _stockSymbol, ); if (_stockSymbol != null) { B You, now. Uncommitted changes await _databaseService.insertStock(Stock( symbol: _stockSymbol.toUpperCase(), name: price: 5)); // Stock = _stockList await _databaseService.getAllStocks FromDb(); _databaseService.printAllStocks InDbToConsole(); setState(() {}); print('${_inputStock} helloooo'); } catch (e) { print('HomeView_inputStock catch: $e'); }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply