sql_recase

Creator: coderz1093

Last updated:

0 purchases

sql_recase Image
sql_recase Images

Languages

Categories

Add to Cart

Description:

sql recase

sql_recase #
Transforms map keys in camelCase or snake_case
Example Usage #
import 'package:sql_recase/sql_recase.dart';

class User {
int userId;
String userName;

User.fromJson(Map<String, dynamic> json, {recaseKey:recaseKeyNone}) {
Map<String, dynamic> j = recaseMap(json, recaseKey);
userId = j['userId'];
userName = j['userName'];
}
}

void main() {
User user = User.fromJson({
"user_id": 45,
"user_name": "John Doe"
}, recaseKey: recaseKeyCamelCase);
print(user.userId);
print(user.userName);
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.