class Company { final int id; final String name; final String code; const Company({required this.id, required this.name, required this.code}); factory Company.fromJson(Map j) => Company( id: j['id'], name: j['name'] ?? '', code: j['code'] ?? '', ); } class Vendor { final int id; final String name; final String code; const Vendor({required this.id, required this.name, required this.code}); factory Vendor.fromJson(Map j) => Vendor( id: j['id'], name: j['name'] ?? '', code: j['code'] ?? '', ); } class Category { final int id; final String name; final String code; const Category({required this.id, required this.name, required this.code}); factory Category.fromJson(Map j) => Category( id: j['id'], name: j['name'] ?? '', code: j['code'] ?? '', ); } class AppUser { final int id; final String username; final String role; const AppUser({required this.id, required this.username, required this.role}); factory AppUser.fromJson(Map j) => AppUser( id: j['id'], username: j['username'] ?? '', role: j['role'] ?? '', ); }