Powerful, helpful, extensible and highly customizable API's that wrap http client to make communication easier with Axelor server with boilerplate code free.
flutter_axelor_sdk:
flutter_axelor_sdk: ^0.0.1
void main() {
Axelor.initialize(
builder: AxelorBuilder(
client: Dio(),
domain: 'com.axelor.testserver.base.db.', // replace with your axelor server prefix
),
);
runApp(const App());
}
Axelor.search(
model: Contacts.model, // auto end point construct
baseDomain: Contacts.baseDomain, // auto end point construct
mapper: Contacts.fromJson, // Auto json decode and map to class object
page: 0, // page pagination support
body: AxelorBody( // Syntactic sugar to construct body
fields: const ['fullName', 'email'],
sortBy: const ['fullName', '-createdOn'],
criteria: AxelorCriteria.or([
'email'.like('%gmail.com'),
'lang'.equal('FR'),
'age'.between('18', '40'),
AxelorCriteria.and(['firstName'.like('j%'), 'lastName'.like('s%')])
]),
),
);
try {
final response = await client.post(
'/ws/rest/com.axelor.contact.db.Contact/search',
data: {
'offset': 0,
'limit': 10,
'fields': ['fullName', 'email'],
'sortBy': ['fullName', '-createdOn'],
'data': {
'criteria': [
{
'operator': 'or',
'criteria': [
{'fieldName': 'email', 'operator': 'like', 'value': '%gmail.com'},
{'fieldName': 'lang', 'operator': '=', 'value': 'FR'},
{'fieldName': 'age', 'operator': 'between', 'value': 18, 'value2': 40},
{
'operator': 'and',
'criteria': [
{'fieldName': 'firstName', 'operator': 'like', 'value': 'j%'},
{'fieldName': 'lastName', 'operator': 'like', 'value': 's%'}
]
}
]
}
]
}
},
);
// decode to json
final Map<String, dynamic> jsonResponse = jsonDecode(response.data);
// check if success response or error happen
if ((jsonResponse['status'] as int?) != 0) {
// propagate error to ui
return;
}
// map json to Contact Class
final contacts = Contacts.fromJson(jsonResponse['data']);
} catch (ex, st) {
// propagate general error to ui
}
- Compatible: Compatible with all your existing code so you can adopt when and where you want.
- Less code: Do more with less code and avoid entire classes of bugs, so code is simple and easy to maintain.
- Highly customizable : The defaults settings will cover you but if not almost every thing is customizable.
- Architecture-agnostic: Works with any architecture approach.
- enterprise-ready: All code is fully tested so it's save to use in production.
- well documented: Each feature is well documented.
- Search
- Advanced Search
- Fetch
- Advanced Fetch
- Delete
- Advanced Delete
- Create
- Update
- Auth Services ⛏️
- Document Services ⛏️
- MetaData Services ⛏️
- Action Service ⛏️
If you have a bug or an idea, read the contributing guidelines before opening an issue.