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

A set of functions used to transform map keys in camelCase or snake_case. Please take a look at dart_mssql package for a usage example

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

Publisher

unverified uploader

Weekly Downloads

A set of functions used to transform map keys in camelCase or snake_case. Please take a look at dart_mssql package for a usage example

Homepage
Repository (GitHub)
View/report issues

License

BSD-2-Clause (license)

Dependencies

recase

More

Packages that depend on sql_recase