-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mock data ile json menu modeli oluşturuldu...dil sayfa adı , icon bil…
…gisi , url bilgisi ve parent bilgisi gibi bilgiler sahte data ile oluşturuldu. translate ile oluşturulan menu isimlerini çevirmek için traslate locale yapısı oıluşturuldu. dil desteği örneği sayfası incelenebilir. (#3)
- Loading branch information
1 parent
b587c99
commit 34b3a6c
Showing
29 changed files
with
862 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" | ||
#include "Generated.xcconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
#include "Generated.xcconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,256 @@ | ||
import 'dart:convert'; | ||
|
||
import 'package:dart_json_mapper/dart_json_mapper.dart'; | ||
|
||
import '../models/menu.dart'; | ||
|
||
class MenuRepository { | ||
MenuRepository(); | ||
|
||
Future<List<Menu>> getMenus() async { | ||
var obj = [ | ||
{ | ||
"id": 2, | ||
"name": "account", | ||
"description": "account", | ||
"url": "/account", | ||
"icon": "account", | ||
"orderPriority": 1, | ||
"active": true, | ||
"parent": { | ||
"id": 1, | ||
"name": "home", | ||
"description": "home", | ||
"url": "/", | ||
"icon": "icon", | ||
"orderPriority": 0, | ||
"active": true, | ||
"level": 0 | ||
}, | ||
"level": 1 | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "logout", | ||
"description": "logout", | ||
"url": "/logout", | ||
"icon": "logout", | ||
"orderPriority": 2, | ||
"active": true, | ||
"parent": { | ||
"id": 2, | ||
"name": "account", | ||
"description": "account", | ||
"url": "/account", | ||
"icon": "account", | ||
"orderPriority": 1, | ||
"active": true, | ||
"level": 1 | ||
}, | ||
"level": 2 | ||
}, | ||
{ | ||
"id": 5, | ||
"name": "settings", | ||
"description": "settings", | ||
"url": "/settings", | ||
"icon": "cog-outline", | ||
"orderPriority": 6, | ||
"active": true, | ||
"parent": { | ||
"id": 1, | ||
"name": "home", | ||
"description": "home", | ||
"url": "/", | ||
"icon": "icon", | ||
"orderPriority": 0, | ||
"active": true, | ||
"level": 0 | ||
}, | ||
"level": 1 | ||
}, | ||
{ | ||
"id": 25, | ||
"name": "language", | ||
"description": "language", | ||
"url": "/language", | ||
"icon": "web", | ||
"orderPriority": 1, | ||
"active": true, | ||
"parent": { | ||
"id": 1, | ||
"name": "home", | ||
"description": "home", | ||
"url": "/", | ||
"icon": "icon", | ||
"orderPriority": 0, | ||
"active": true, | ||
"level": 0 | ||
}, | ||
"level": 1 | ||
}, | ||
{ | ||
"id": 8, | ||
"name": "register", | ||
"description": "register", | ||
"url": "/register", | ||
"icon": "account-tie", | ||
"orderPriority": 2, | ||
"active": true, | ||
"parent": { | ||
"id": 1, | ||
"name": "home", | ||
"description": "home", | ||
"url": "/", | ||
"icon": "icon", | ||
"orderPriority": 0, | ||
"active": true, | ||
"level": 0 | ||
}, | ||
"level": 1 | ||
}, { | ||
"id": 20, | ||
"name": " New account", | ||
"description": "New account", | ||
"url": "/account", | ||
"icon": "account-tie", | ||
"orderPriority": 2, | ||
"active": true, | ||
"parent": { | ||
"id": 1, | ||
"name": "home", | ||
"description": "home", | ||
"url": "/", | ||
"icon": "icon", | ||
"orderPriority": 0, | ||
"active": true, | ||
"level": 0 | ||
}, | ||
"level": 1 | ||
}, | ||
{ | ||
"id": 9, | ||
"name": "createOffer", | ||
"description": "createOffer", | ||
"url": "/salesPerson/createOffer", | ||
"icon": "account-multiple-plus-outline", | ||
"orderPriority": 1, | ||
"active": true, | ||
"parent": { | ||
"id": 8, | ||
"name": "salesPerson", | ||
"description": "salesPerson", | ||
"url": "/salesPerson", | ||
"icon": "account-tie", | ||
"orderPriority": 2, | ||
"active": true, | ||
"level": 1 | ||
}, | ||
"level": 2 | ||
}, | ||
{ | ||
"id": 10, | ||
"name": "editOffer", | ||
"description": "editOffer", | ||
"url": "/salesPerson/editOffer", | ||
"icon": "account-edit-outline", | ||
"orderPriority": 2, | ||
"active": true, | ||
"parent": { | ||
"id": 8, | ||
"name": "salesPerson", | ||
"description": "salesPerson", | ||
"url": "/salesPerson", | ||
"icon": "account-tie", | ||
"orderPriority": 2, | ||
"active": true, | ||
"level": 1 | ||
}, | ||
"level": 2 | ||
}, | ||
{ | ||
"id": 11, | ||
"name": "customer", | ||
"description": "customer", | ||
"url": "/customer", | ||
"icon": "account-group-outline", | ||
"orderPriority": 3, | ||
"active": true, | ||
"parent": { | ||
"id": 1, | ||
"name": "home", | ||
"description": "home", | ||
"url": "/", | ||
"icon": "icon", | ||
"orderPriority": 0, | ||
"active": true, | ||
"level": 0 | ||
}, | ||
"level": 1 | ||
}, | ||
{ | ||
"id": 14, | ||
"name": "dashboard", | ||
"description": "dashboard", | ||
"url": "/dashboard", | ||
"icon": "finance", | ||
"orderPriority": 5, | ||
"active": true, | ||
"parent": { | ||
"id": 1, | ||
"name": "home", | ||
"description": "home", | ||
"url": "/", | ||
"icon": "icon", | ||
"orderPriority": 0, | ||
"active": true, | ||
"level": 0 | ||
}, | ||
"level": 1 | ||
}, | ||
{ | ||
"id": 20, | ||
"name": "tasks", | ||
"description": "tasks", | ||
"url": "/tasks", | ||
"icon": "file-chart", | ||
"orderPriority": 4, | ||
"active": true, | ||
"parent": { | ||
"id": 1, | ||
"name": "home", | ||
"description": "home", | ||
"url": "/", | ||
"icon": "icon", | ||
"orderPriority": 0, | ||
"active": true, | ||
"level": 0 | ||
}, | ||
"level": 1 | ||
}, | ||
{ | ||
"id": 22, | ||
"name": "login", | ||
"description": "login", | ||
"url": "/login", | ||
"icon": "information", | ||
"orderPriority": 1, | ||
"active": true, | ||
"parent": { | ||
"id": 2, | ||
"name": "account", | ||
"description": "account", | ||
"url": "/account", | ||
"icon": "account", | ||
"orderPriority": 1, | ||
"active": true, | ||
"level": 1 | ||
}, | ||
"level": 2 | ||
} | ||
]; | ||
List<Menu> menus = JsonMapper.deserialize<List<Menu>>(obj)!; | ||
|
||
return menus; | ||
} | ||
} |
Oops, something went wrong.