Skip to content

Commit

Permalink
Merge pull request #43 from nishantkr18/workshop_search
Browse files Browse the repository at this point in the history
search functionality in home page
  • Loading branch information
mohit-mangal authored Apr 16, 2020
2 parents 4477008 + 31d50b8 commit c6c8e68
Show file tree
Hide file tree
Showing 7 changed files with 684 additions and 46 deletions.
17 changes: 17 additions & 0 deletions lib/data/post_api_service.chopper.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions lib/data/post_api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ abstract class PostApiService extends ChopperService {
@Header('Authorization') String token,
@Body() BuiltWorkshopDetailPost body);

@Post(path: '/workshops/search/')
Future<Response<BuiltAllWorkshopsPost>> searchWorkshopByString(
@Body() BuiltWorkshopSearchByStringPost body);

@Post(path: '/workshops/search/date/')
Future<Response<BuiltList<BuiltWorkshopSummaryPost>>> searchWorkshopByDate(
@Body() BuiltWorkshopSearchByDatePost body);

static PostApiService create() {
final client = ChopperClient(
baseUrl: 'https://workshops-app-backend.herokuapp.com',
Expand Down
38 changes: 38 additions & 0 deletions lib/model/built_post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,44 @@ abstract class ContactPost implements Built<ContactPost, ContactPostBuilder> {
static Serializer<ContactPost> get serializer => _$contactPostSerializer;
}

abstract class BuiltWorkshopSearchByStringPost
implements
Built<BuiltWorkshopSearchByStringPost,
BuiltWorkshopSearchByStringPostBuilder> {
@nullable
String get search_by;
@nullable
String get search_string;

BuiltWorkshopSearchByStringPost._();

factory BuiltWorkshopSearchByStringPost(
[updates(BuiltWorkshopSearchByStringPostBuilder b)]) =
_$BuiltWorkshopSearchByStringPost;

static Serializer<BuiltWorkshopSearchByStringPost> get serializer =>
_$builtWorkshopSearchByStringPostSerializer;
}

abstract class BuiltWorkshopSearchByDatePost
implements
Built<BuiltWorkshopSearchByDatePost,
BuiltWorkshopSearchByDatePostBuilder> {
@nullable
String get start_date;
@nullable
String get end_date;

BuiltWorkshopSearchByDatePost._();

factory BuiltWorkshopSearchByDatePost(
[updates(BuiltWorkshopSearchByDatePostBuilder b)]) =
_$BuiltWorkshopSearchByDatePost;

static Serializer<BuiltWorkshopSearchByDatePost> get serializer =>
_$builtWorkshopSearchByDatePostSerializer;
}

// !--------------------------------------------------------------------------------------------------------------------
abstract class BuiltAllCouncilsPost
implements Built<BuiltAllCouncilsPost, BuiltAllCouncilsPostBuilder> {
Expand Down
Loading

0 comments on commit c6c8e68

Please sign in to comment.