sql_recase 0.2.1 copy "sql_recase: ^0.2.1" to clipboard
sql_recase: ^0.2.1 copied to clipboard

outdated

Transforms map keys in camelCase or snake_case

example/main.dart

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);
}
0
likes
25
points
27
downloads

Publisher

unverified uploader

Weekly Downloads

Transforms map keys in camelCase or snake_case

Homepage
Repository (GitHub)
View/report issues

License

BSD-2-Clause (license)

Dependencies

recase

More

Packages that depend on sql_recase