-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy version 2.7.0+24 for testing
- Loading branch information
Showing
10 changed files
with
479 additions
and
3 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
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ lane :bump_version do |options| | |
parts: options[:bump], | ||
pubspec: "../pubspec.yaml" | ||
) | ||
if(options[:push] && options[:bump]) | ||
if(options[:push] || options[:bump]) | ||
sh "git config --global user.email [email protected]" | ||
sh "git config --global user.name Mohammed chahboun" | ||
sh "git config --global push.followTags true" | ||
|
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,96 @@ | ||
import 'package:mvc_rocket/mvc_rocket.dart'; | ||
|
||
import 'user_submodel/address_submodel.dart'; | ||
import 'user_submodel/company_submodel.dart'; | ||
|
||
const String userIdField = "id"; | ||
const String userNameField = "name"; | ||
const String userUsernameField = "username"; | ||
const String userEmailField = "email"; | ||
const String userAddressField = "address"; | ||
const String userPhoneField = "phone"; | ||
const String userWebsiteField = "website"; | ||
const String userCompanyField = "company"; | ||
const String userImageField = "image"; | ||
|
||
class User extends RocketModel<User> { | ||
int? id; | ||
String? name; | ||
String? username; | ||
String? email; | ||
Address? address; | ||
String? phone; | ||
String? website; | ||
Company? company; | ||
String? image; | ||
|
||
User( | ||
{this.id, | ||
this.name, | ||
this.username, | ||
this.email, | ||
this.address, | ||
this.phone, | ||
this.website, | ||
this.company, | ||
this.image}) { | ||
address ??= Address(); | ||
company ??= Company(); | ||
} | ||
|
||
@override | ||
void fromJson(Map<String, dynamic> json, {bool isSub = false}) { | ||
id = json[userIdField]; | ||
name = json[userNameField]; | ||
username = json[userUsernameField]; | ||
email = json[userEmailField]; | ||
address!.fromJson(json[userAddressField]); | ||
phone = json[userPhoneField]; | ||
website = json[userWebsiteField]; | ||
image = json[userImageField]; | ||
company!.fromJson(json[userCompanyField]); | ||
super.fromJson(json, isSub: isSub); | ||
} | ||
|
||
void updateFields({ | ||
int? idField, | ||
String? nameField, | ||
String? usernameField, | ||
String? emailField, | ||
Address? addressField, | ||
String? phoneField, | ||
String? websiteField, | ||
Company? companyField, | ||
String? imageField, | ||
}) { | ||
id = idField ?? id; | ||
name = nameField ?? name; | ||
username = usernameField ?? username; | ||
email = emailField ?? email; | ||
address = addressField ?? address; | ||
phone = phoneField ?? phone; | ||
image = imageField ?? image; | ||
website = websiteField ?? website; | ||
company = companyField ?? company; | ||
rebuildWidget(fromUpdate: true); | ||
} | ||
|
||
@override | ||
Map<String, dynamic> toJson() { | ||
final Map<String, dynamic> data = {}; | ||
data[userIdField] = id; | ||
data[userNameField] = name; | ||
data[userUsernameField] = username; | ||
data[userEmailField] = email; | ||
data[userAddressField] = address!.toJson(); | ||
data[userPhoneField] = phone; | ||
data[userWebsiteField] = website; | ||
data[userCompanyField] = company!.toJson(); | ||
data[userImageField] = image; | ||
|
||
return data; | ||
} | ||
|
||
@override | ||
get instance => User(); | ||
} |
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,63 @@ | ||
import 'package:flutter_ci_cd/models/user_submodel/geo_submodel.dart'; | ||
import 'package:mvc_rocket/mvc_rocket.dart'; | ||
|
||
const String addressStreetField = "street"; | ||
const String addressSuiteField = "suite"; | ||
const String addressCityField = "city"; | ||
const String addressZipcodeField = "zipcode"; | ||
const String addressGeoField = "geo"; | ||
|
||
class Address extends RocketModel<Address> { | ||
String? street; | ||
String? suite; | ||
String? city; | ||
String? zipcode; | ||
Geo? geo; | ||
|
||
Address({ | ||
this.street, | ||
this.suite, | ||
this.city, | ||
this.zipcode, | ||
this.geo, | ||
}) { | ||
geo ??= Geo(); | ||
} | ||
|
||
@override | ||
void fromJson(Map<String, dynamic> json, {bool isSub = false}) { | ||
street = json[addressStreetField]; | ||
suite = json[addressSuiteField]; | ||
city = json[addressCityField]; | ||
zipcode = json[addressZipcodeField]; | ||
geo!.fromJson(json[addressGeoField]); | ||
super.fromJson(json, isSub: isSub); | ||
} | ||
|
||
void updateFields({ | ||
String? streetField, | ||
String? suiteField, | ||
String? cityField, | ||
String? zipcodeField, | ||
Geo? geoField, | ||
}) { | ||
street = streetField ?? street; | ||
suite = suiteField ?? suite; | ||
city = cityField ?? city; | ||
zipcode = zipcodeField ?? zipcode; | ||
geo = geoField ?? geo; | ||
rebuildWidget(fromUpdate: true); | ||
} | ||
|
||
@override | ||
Map<String, dynamic> toJson() { | ||
final Map<String, dynamic> data = {}; | ||
data[addressStreetField] = street; | ||
data[addressSuiteField] = suite; | ||
data[addressCityField] = city; | ||
data[addressZipcodeField] = zipcode; | ||
data[addressGeoField] = geo!.toJson(); | ||
|
||
return data; | ||
} | ||
} |
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,46 @@ | ||
import 'package:mvc_rocket/mvc_rocket.dart'; | ||
|
||
const String companyNameField = "name"; | ||
const String companyCatchPhraseField = "catchPhrase"; | ||
const String companyBsField = "bs"; | ||
|
||
class Company extends RocketModel<Company> { | ||
String? name; | ||
String? catchPhrase; | ||
String? bs; | ||
|
||
Company({ | ||
this.name, | ||
this.catchPhrase, | ||
this.bs, | ||
}); | ||
|
||
@override | ||
void fromJson(Map<String, dynamic> json, {bool isSub = false}) { | ||
name = json[companyNameField]; | ||
catchPhrase = json[companyCatchPhraseField]; | ||
bs = json[companyBsField]; | ||
super.fromJson(json, isSub: isSub); | ||
} | ||
|
||
void updateFields({ | ||
String? nameField, | ||
String? catchPhraseField, | ||
String? bsField, | ||
}) { | ||
name = nameField ?? name; | ||
catchPhrase = catchPhraseField ?? catchPhrase; | ||
bs = bsField ?? bs; | ||
rebuildWidget(fromUpdate: true); | ||
} | ||
|
||
@override | ||
Map<String, dynamic> toJson() { | ||
final Map<String, dynamic> data = {}; | ||
data[companyNameField] = name; | ||
data[companyCatchPhraseField] = catchPhrase; | ||
data[companyBsField] = bs; | ||
|
||
return data; | ||
} | ||
} |
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,38 @@ | ||
import 'package:mvc_rocket/mvc_rocket.dart'; | ||
|
||
const String geoLatField = "lat"; | ||
const String geoLngField = "lng"; | ||
|
||
class Geo extends RocketModel<Geo> { | ||
String? lat; | ||
String? lng; | ||
|
||
Geo({ | ||
this.lat, | ||
this.lng, | ||
}); | ||
@override | ||
void fromJson(Map<String, dynamic> json, {bool isSub = false}) { | ||
lat = json[geoLatField]; | ||
lng = json[geoLngField]; | ||
super.fromJson(json, isSub: isSub); | ||
} | ||
|
||
void updateFields({ | ||
String? latField, | ||
String? lngField, | ||
}) { | ||
lat = latField ?? lat; | ||
lng = lngField ?? lng; | ||
rebuildWidget(fromUpdate: true); | ||
} | ||
|
||
@override | ||
Map<String, dynamic> toJson() { | ||
final Map<String, dynamic> data = {}; | ||
data[geoLatField] = lat; | ||
data[geoLngField] = lng; | ||
|
||
return data; | ||
} | ||
} |
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,9 @@ | ||
import 'package:flutter_ci_cd/models/user_model.dart'; | ||
import 'package:mvc_rocket/mvc_rocket.dart'; | ||
|
||
const String usersEndpoint = "users"; | ||
|
||
class GetUsers { | ||
static Future getUsers(User userModel) => Rocket.get(rocketRequestKey) | ||
.getObjData(usersEndpoint, userModel, multi: true); | ||
} |
Oops, something went wrong.