skip to Main Content

flutter/dart Api and WordPress authorization

I wanted to make connection with my WordPress with API, I successfully made the connection and fetched JSON, here is the connection code // ignore_for_file: avoid_print import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:testapi/courses.dart'; Future fetchCourses() async { String username…

VIEW QUESTION

I´ve a problem with the BottomNavigationBar in Flutter . BottomNavigationBarItem: title is not working and there is error

enter image description herethis is the error occur. bottomNavigationBar: BottomNavigationBar( items: const <BottomNavigationBarItem>[ BottomNavigationBarItem( icon: Icon( Icons.home, ), title: Text( 'Home', ), ), BottomNavigationBarItem( icon: Icon( Icons.message, ), title: Text( 'Messages', ), ), BottomNavigationBarItem( icon: Icon( Icons.person, ), title: Text(…

VIEW QUESTION

Flutter – How to modify a Model in Dart?

I try to modify an object: void main() { Model item = Model(list: [3,4]); print(item.list); Model test = item; List modifyList = test.list!; modifyList[0] = 999; test = Model(list: modifyList); print("original: " + item.list.toString()); print("modified: " + test.list.toString()); } class…

VIEW QUESTION

After I update the flutter there's an import error in flutter

/C:/Users/DL/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:6:1: Error: 'DatePickerTheme' is imported from both 'package:flutter/src/material/date_picker_theme.dart' and 'package:flutter_datetime_picker/src/datetime_picker_theme.dart'. import 'package:flutter_datetime_picker/src/datetime_picker_theme.dart'; datetime_picker_theme.dart:1 ^^^^^^^^^^^^^^^ /C:/Users/DL/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_datetime_picker-1.5.1/lib/flutter_datetime_picker.dart:199:31: Error: 'DatePickerTheme' is imported from both 'package:flutter/src/material/date_picker_theme.dart' and 'package:flutter_datetime_picker/src/datetime_picker_theme.dart'. this.theme = theme ?? DatePickerTheme(), ^^^^^^^^^^^^^^^ Failed to compile application. this error happens after I update

VIEW QUESTION

Flutter – Set Future<Model> as null

I have a variable late Future<QuestionModel> question; and a function that fetches QuestionModel fetchQuestion(){ // Question model is initialised here } It is being used in build to display a UI FutureBuilder( future: question, builder: (context, snapshot) { if (snapshot.data…

VIEW QUESTION
Back To Top
Search