''PopularProductController' doesn't conform to the bound 'GetxController' of the type parameter 'T'
ist code is there . some one help me for this issu . i can't solve this issu .this type of problem i face first time so i can't solve it .please someone help me
Widget build(BuildContext context) {
print("current height is " + MediaQuery.of(context).size.height.toString());
print("current width is " + MediaQuery.of(context).size.width.toString());
return Column(
children: [
//slider section
GetBuilder<PopularProductController>(builder:(popularproducts){
return Container(
// color: Colors.blue,
height: Dimentions.pageView,
child: PageView.builder(
controller: pageController,
itemCount: 5,
itemBuilder: (context, position) {
return _buildPageItem(position);
},
),
);
second code is controller section code . some one help me for this issu . i can't solve this issu .this type of problem i face first time so i can't solve it .please someone help me.
import 'package:fooddeliver/data/repository/popular_product_repo.dart';
import 'package:fooddeliver/modals/products_modal.dart';
import 'package:get/get.dart';
class PopularProductController extends GetxService {
final PopularProductRepo popularProductRepo;
PopularProductController({required this.popularProductRepo});
List<dynamic> _popularProductList = [];
List<dynamic> get popularProductList => _popularProductList;
Future<void> getPopularProductList() async {
Response response = await popularProductRepo.getPopularProductlist();
if (response.statusCode == 200) {
_popularProductList = [];
print('product list');
_popularProductList.addAll(Product.fromJson(response.body).products);
print(_popularProductList);
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

