-
-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add:Filters * Add:Documentation * Add:MultiLingual Support * Fix:Format * Reduced: Lines of Codes * Fixed:Tests * Add:Fix Failing test case * Add:Tests for requested lines * Add:test for filter changing * Fixed:changes requested * Add:Changes * Fix:Documentation * Fix:Dart version * Fixed:spacing * Remove: useless docs * Remove:Spaces * Removed:spaces * Fix:Constant Sizes * Fix:Format issues * Minor FIx * Fix:format * Fix:Dynamic size * Fix:Dynamic size * Fix:Failing test * Fix:Failing test
- Loading branch information
1 parent
270ad70
commit 9438a45
Showing
17 changed files
with
460 additions
and
74 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
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
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
150 changes: 150 additions & 0 deletions
150
lib/views/after_auth_screens/events/event_filter_bottomsheet.dart
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,150 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:talawa/apptheme.dart'; | ||
import 'package:talawa/services/size_config.dart'; | ||
import 'package:talawa/utils/app_localization.dart'; | ||
import 'package:talawa/view_model/after_auth_view_models/event_view_models/explore_events_view_model.dart'; | ||
|
||
/// Shows a list of dropdown taken from `model` and `context`. | ||
/// | ||
/// **params**: | ||
/// * `model`: contains the events data | ||
/// * `context`: the overall context of UI | ||
/// | ||
/// **returns**: | ||
/// * `Widget`: the dropdown | ||
Widget dropDownList( | ||
ExploreEventsViewModel model, | ||
BuildContext context, | ||
) { | ||
final Map<String, String> filters = { | ||
'All Events': 'Show all events', | ||
'My Events': 'Show all events created by you', | ||
'Registered Events': 'Show all events you have registered', | ||
'Public Events': 'Show events for all', | ||
'Private Events': 'Show invite-only events', | ||
}; | ||
return SizedBox( | ||
height: SizeConfig.screenHeight, | ||
width: SizeConfig.screenWidth, | ||
child: Padding( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: SizeConfig.safeBlockHorizontal! * 10, | ||
), | ||
child: StatefulBuilder( | ||
builder: (_, StateSetter setState) { | ||
return SingleChildScrollView( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
SizedBox( | ||
height: SizeConfig.safeBlockVertical, | ||
), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Text( | ||
AppLocalizations.of( | ||
context, | ||
)! | ||
.strictTranslate( | ||
"Filters", | ||
), | ||
style: Theme.of( | ||
context, | ||
).textTheme.headlineSmall, | ||
), | ||
IconButton( | ||
key: const Key('close'), | ||
onPressed: () { | ||
Navigator.pop(context); | ||
}, | ||
icon: const Icon( | ||
Icons.close, | ||
), | ||
), | ||
], | ||
), | ||
...List.generate( | ||
filters.length, | ||
(index) { | ||
return Padding( | ||
padding: EdgeInsets.symmetric( | ||
vertical: SizeConfig.safeBlockVertical! * 2, | ||
), | ||
child: GestureDetector( | ||
onTap: () { | ||
model.choseValueFromDropdown( | ||
filters.keys.toList()[index], | ||
); | ||
setState(() {}); | ||
}, | ||
child: Container( | ||
key: Key( | ||
filters.keys.toList()[index], | ||
), | ||
decoration: BoxDecoration( | ||
color: model.chosenValue == | ||
filters.keys.toList()[index] | ||
? Theme.of(context).colorScheme.secondary | ||
: AppTheme.white, | ||
borderRadius: BorderRadius.all( | ||
Radius.circular( | ||
SizeConfig.safeBlockHorizontal! * 2, | ||
), | ||
), | ||
), | ||
width: SizeConfig.screenWidth! - 60, | ||
child: Padding( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: SizeConfig.safeBlockHorizontal! * 5, | ||
vertical: SizeConfig.safeBlockVertical! / 2, | ||
), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Text( | ||
AppLocalizations.of(context)!.strictTranslate( | ||
filters.keys.toList()[index], | ||
), | ||
style: Theme.of(context) | ||
.textTheme | ||
.labelLarge! | ||
.copyWith( | ||
color: model.chosenValue == | ||
filters.keys.toList()[index] | ||
? AppTheme.white | ||
: AppTheme.blackPrimary, | ||
), | ||
), | ||
Text( | ||
AppLocalizations.of(context)!.strictTranslate( | ||
filters.values.toList()[index], | ||
), | ||
style: Theme.of(context) | ||
.textTheme | ||
.labelSmall! | ||
.copyWith( | ||
color: model.chosenValue == | ||
filters.keys.toList()[index] | ||
? AppTheme.white | ||
: AppTheme.blackSecondary, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
), | ||
), | ||
); | ||
} |
Oops, something went wrong.