Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush0Chaudhary committed Feb 9, 2023
2 parents 52a881a + 1b09ba4 commit 3bea609
Show file tree
Hide file tree
Showing 11 changed files with 626 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ class CreateEventViewModel extends BaseModel {
variables: variables,
);
navigationService.pop();
print('Result is : $result');
if (result != null) {
navigationService.pop();

Expand Down Expand Up @@ -154,7 +153,6 @@ class CreateEventViewModel extends BaseModel {

void buildUserList({required bool isAdmin}) {
isAdmin ? _selectedAdmins.clear() : _selectedMembers.clear();

orgMembersList.forEach((orgMember) {
if (_adminCheckedMap[orgMember.id] == true && isAdmin) {
_selectedAdmins.add(orgMember);
Expand Down
5 changes: 4 additions & 1 deletion lib/views/after_auth_screens/events/create_event_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class _CreateEventPageState extends State<CreateEventPage> {
width: SizeConfig.screenWidth! * 0.036,
),
TextButton(
key: const Key('create_evt_add_img'),
key: const Key('txt_btn_cep'),
onPressed: () => model.getImageFromGallery(),
child: Text(
AppLocalizations.of(context)!
Expand Down Expand Up @@ -163,6 +163,7 @@ class _CreateEventPageState extends State<CreateEventPage> {
height: SizeConfig.screenHeight! * 0.013,
),
DateTimeTile(
key: const Key('key for test cep'),
date: "${model.eventEndDate.toLocal()}".split(' ')[0],
time: model.eventEndTime.format(context),
setDate: () async {
Expand Down Expand Up @@ -260,6 +261,7 @@ class _CreateEventPageState extends State<CreateEventPage> {
SizedBox(height: SizeConfig.screenHeight! * 0.026),
const Divider(),
InkWell(
key: const Key('inwell_cep1'),
onTap: () {
EventBottomSheet().addUserBottomSheet(
context: context,
Expand Down Expand Up @@ -298,6 +300,7 @@ class _CreateEventPageState extends State<CreateEventPage> {
SizedBox(height: SizeConfig.screenHeight! * 0.026),
const Divider(),
InkWell(
key: const Key('inwell_cep2'),
onTap: () {
EventBottomSheet().addUserBottomSheet(
context: context,
Expand Down
19 changes: 19 additions & 0 deletions lib/views/main_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ class _MainScreenState extends State<MainScreen> {
icon: const Icon(Icons.home),
label: AppLocalizations.of(context)!.strictTranslate('Home'),
),
BottomNavigationBarItem(
icon: const Icon(Icons.event_note),
label: AppLocalizations.of(context)!.strictTranslate('Events'),
),
BottomNavigationBarItem(
icon: const Icon(Icons.add_box),
label: AppLocalizations.of(context)!.strictTranslate('Add'),
),
BottomNavigationBarItem(
icon: const Icon(Icons.chat_outlined),
label: AppLocalizations.of(context)!.strictTranslate('Chat'),
),
BottomNavigationBarItem(
icon: const Icon(Icons.account_circle),
label: AppLocalizations.of(context)!.strictTranslate('Profile'),
Expand Down Expand Up @@ -183,6 +195,13 @@ class _MainScreenState extends State<MainScreen> {
/// When talawa app receives the plugins data is will dynamically render more components from the construtor.
navBarClasses = [
OrganizationFeed(key: const Key("HomeView"), homeModel: model),
ExploreEvents(key: const Key('ExploreEvents'), homeModel: model),
AddPost(
key: const Key('AddPost'),
drawerKey: MainScreenViewModel.scaffoldKey),
const ChatPage(
key: Key('Chats'),
),
ProfilePage(key: model.keySPEditProfile, homeModel: model),
];
// ignore_for_file: unused_local_variable
Expand Down
1 change: 1 addition & 0 deletions lib/widgets/add_members_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class EventBottomSheet {
style: const TextStyle(fontSize: 16),
),
TextButton(
key: const Key('text_btn_ambs1'),
onPressed: () {
model.buildUserList(isAdmin: isAdmin);
Navigator.pop(context);
Expand Down
17 changes: 17 additions & 0 deletions test/helpers/test_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,23 @@ OrganizationService getAndRegisterOrganizationService() {
_removeRegistrationIfExists<OrganizationService>();
final service = MockOrganizationService();
locator.registerSingleton<OrganizationService>(service);

final User user1 = User(
id: "fakeUser1",
firstName: 'ayush',
lastName: 'chaudhary',
image: 'www.image.com',
);
final User user2 = User(
id: "fakeUser2",
firstName: 'ayush',
lastName: 'chaudhary',
image: 'www.image.com',
);
final List<User> users = [user1, user2];
when(service.getOrgMembersList('XYZ')).thenAnswer((realInvocation) async {
return users;
});
return service;
}

Expand Down
11 changes: 11 additions & 0 deletions test/helpers/test_helpers.mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,17 @@ class MockNavigationService extends _i2.Mock implements _i7.NavigationService {
Invocation.method(#showSnackBar, [message], {#duration: duration}),
returnValueForMissingStub: null);
@override
void showTalawaErrorWidget(String? errorMessage,
{Duration? duration = const Duration(seconds: 2)}) =>
super.noSuchMethod(
Invocation.method(
#showTalawaErrorWidget, [errorMessage], {#duration: duration}),
returnValueForMissingStub: null);
@override
void showTalawaErrorDialog(String? errorMessage) => super.noSuchMethod(
Invocation.method(#showTalawaErrorDialog, [errorMessage]),
returnValueForMissingStub: null);
@override
void pop() => super.noSuchMethod(Invocation.method(#pop, []),
returnValueForMissingStub: null);
}
Expand Down
2 changes: 2 additions & 0 deletions test/helpers/test_locator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:talawa/view_model/after_auth_view_models/event_view_models/explo
import 'package:talawa/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart';
import 'package:talawa/view_model/after_auth_view_models/profile_view_models/edit_profile_view_model.dart';
import 'package:talawa/view_model/after_auth_view_models/profile_view_models/profile_page_view_model.dart';
import 'package:talawa/view_model/after_auth_view_models/task_view_models/explore_tasks_view_model.dart';
import 'package:talawa/view_model/lang_view_model.dart';
import 'package:talawa/view_model/main_screen_view_model.dart';
import 'package:talawa/view_model/pre_auth_view_models/login_view_model.dart';
Expand Down Expand Up @@ -93,6 +94,7 @@ void testSetupLocator() {
locator.registerFactory(() => EditEventViewModel());
locator.registerFactory(() => AddPostViewModel());
locator.registerFactory(() => EventInfoViewModel());
locator.registerFactory(() => ExploreTasksViewModel());

//Widgets viewModels
locator.registerFactory(() => ProgressDialogViewModel());
Expand Down
Loading

0 comments on commit 3bea609

Please sign in to comment.