-
-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: redesign the select organisation screen. (#1891)
* Fixes #1612 No Messaging When No Organizations are Created * Add constant time-out for loading data. * Add constant time-out for loading data. * chore: Add request-screen-1 with optional message. * formatting * feat: Added final UI comp, according to the design. * chore: Added dart formatting * chore: remove darker shade from app bar * feat: Add viewmodel logic for waiting screen. * Chore: redeisgn the select organization screen. * formatting * Draft Commit * Merged All the flow of new Member Management. * Fixed the failing test * Fixed the failing test * Removed the unsed imports. * Fixed the formating * Some last changes * formatting * formatting * formatting * added documentation * added documentation * added documentation * wrote test for set_url, custon tile, select org, according to the new UI * draft * Add the test for select org VM and join org after auth screen according to the new implementation. * formatting * formatting
- Loading branch information
1 parent
1dd4b17
commit a24acc7
Showing
19 changed files
with
832 additions
and
836 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,107 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/rendering.dart'; | ||
// import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
|
||
class AppTheme { | ||
// Text Styles | ||
static TextStyle title = const TextStyle( | ||
fontSize: 20, | ||
fontWeight: FontWeight.w600, | ||
color: blackPrimary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle headline1 = const TextStyle( | ||
fontSize: 24, | ||
fontWeight: FontWeight.w600, | ||
color: blackPrimary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle headline2 = const TextStyle( | ||
fontSize: 18, | ||
fontWeight: FontWeight.w600, | ||
color: blackPrimary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle headline3 = const TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w600, | ||
color: blackPrimary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle headline4 = const TextStyle( | ||
fontSize: 14, | ||
fontWeight: FontWeight.w600, | ||
color: blackPrimary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle headline5 = const TextStyle( | ||
fontSize: 12, | ||
fontWeight: FontWeight.w600, | ||
color: blackPrimary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle headline6 = const TextStyle( | ||
fontSize: 10, | ||
fontWeight: FontWeight.w600, | ||
color: blackPrimary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle subtitle1 = const TextStyle( | ||
fontSize: 14, | ||
fontWeight: FontWeight.w500, | ||
color: blackSecondary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle subtitle2 = const TextStyle( | ||
fontSize: 12, | ||
fontWeight: FontWeight.w500, | ||
color: blackSecondary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle bodyText1 = const TextStyle( | ||
fontSize: 12, | ||
fontWeight: FontWeight.w400, | ||
color: blackSecondary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle bodyText2 = const TextStyle( | ||
fontSize: 8, | ||
fontWeight: FontWeight.w400, | ||
color: blackSecondary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle bodyText3 = const TextStyle( | ||
fontSize: 10, | ||
fontWeight: FontWeight.w400, | ||
color: blackSecondary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle overline = const TextStyle( | ||
fontSize: 6, | ||
fontWeight: FontWeight.w400, | ||
color: blackSecondary, | ||
fontFamily: 'OpenSans', | ||
); | ||
static TextStyle button = const TextStyle( | ||
fontSize: 16, | ||
fontWeight: FontWeight.w600, | ||
color: primary, | ||
fontFamily: 'OpenSans', | ||
); | ||
|
||
// Colors | ||
static const Color primary = Color(0xFFFFC107); | ||
static const Color secondary = Color(0xFF795548); | ||
static const Color tertiary = Color(0xFFA16938); | ||
static const Color white = Color(0xFFFFFFFF); | ||
static const Color red = Color(0xFFEB5757); | ||
static const Color blue = Color(0xFF2196F3); | ||
static const Color yellow = Color(0xffF6BA18); | ||
static const Color green = Color(0xFF2ACC00); | ||
static const Color grey = Color(0xFFD2D2D2); | ||
static const Color lightGrey = Color(0xFFECECEC); | ||
static const Color blackPrimary = Color(0xFF3E3E3E); | ||
static const Color blackSecondary = Color(0xFF636363); | ||
static const Color blackTertiary = Color(0xFFAEAEAE); | ||
static const Color shadow = Color(0x408E8E8E); | ||
} |
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,38 +1,99 @@ | ||
// ignore_for_file: talawa_api_doc | ||
// ignore_for_file: talawa_good_doc_comments | ||
|
||
///This file contains the routes. | ||
///This file contains the routes. These can be used to make push screen call via Routes.splashScreen to access these string. | ||
class Routes { | ||
/// static variables. | ||
static const String demoPageViewRoute = "/demoPageViewRoute"; | ||
|
||
/// static variables. | ||
static const String splashScreen = "/"; | ||
|
||
/// static variables. | ||
static const String languageSelectionRoute = "/selectLang"; | ||
|
||
/// static variables. | ||
static const String setUrlScreen = "/setUrl"; | ||
|
||
/// static variables. | ||
static const String loginScreen = "/login"; | ||
|
||
/// static variables. | ||
static const String selectOrgScreen = "/selectOrg"; | ||
|
||
/// static variables. | ||
static const String signupDetailScreen = "/signupDetails"; | ||
|
||
/// static variables. | ||
static const String waitingScreen = "/waiting"; | ||
|
||
/// static variables. | ||
static const String recoverScreen = "/recover"; | ||
|
||
/// static variables. | ||
static const String updateScreen = "/update"; | ||
|
||
/// static variables. | ||
static const String homeScreen = "/homeScreen"; | ||
|
||
/// static variables. | ||
static const String mainScreen = "/mainScreen"; | ||
|
||
/// static variables. | ||
static const String progressDialog = "/progress"; | ||
|
||
/// static variables. | ||
static const String individualPost = "/individualPost"; | ||
|
||
/// static variables. | ||
static const String pinnedPostPage = "/pinnedPostPage"; | ||
|
||
/// static variables. | ||
static const String exploreEventsScreen = "/exploreEvents"; | ||
|
||
/// static variables. | ||
static const String eventInfoPage = "/eventInfo"; | ||
|
||
/// static variables. | ||
static const String createEventPage = "/createEventPage"; | ||
|
||
/// static variables. | ||
static const String profilePage = "/profilePage"; | ||
|
||
/// static variables. | ||
static const String editProfilePage = "/editProfilePage"; | ||
|
||
/// static variables. | ||
static const String joinOrg = '/joinOrg'; | ||
|
||
/// static variables. | ||
static const String requestAccess = '/requestAccess'; | ||
|
||
/// static variables. | ||
static const String editEventPage = "/editEventPage"; | ||
|
||
/// static variables. | ||
static const String appSettings = '/appSettingsPage'; | ||
|
||
/// static variables. | ||
static const String chatMessageScreen = '/chatMessageScreen'; | ||
|
||
/// static variables. | ||
static const String mapScreen = '/mapScreen'; | ||
|
||
/// static variables. | ||
static const String calendar = '/calendar'; | ||
|
||
/// static variables. | ||
static const String eventTasks = '/event_tasks'; | ||
|
||
/// static variables. | ||
static const String userTasks = '/user_tasks'; | ||
|
||
/// static variables. | ||
static const String addTask = '/addTask'; | ||
|
||
/// static variables. | ||
static const String editTask = '/editTask'; | ||
|
||
/// static variables. | ||
static const String selectContact = '/selectContact'; | ||
} |
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,11 @@ | ||
/// Class to define constant timeout to bring consistency in the code. | ||
class TimeOuts { | ||
/// For small timeout, used for small data fetch. | ||
static const small = 5; | ||
|
||
/// For medium timeout, used for medium data fetch. | ||
static const mediums = 100; | ||
|
||
/// For large timeout, used for large data fetch. | ||
static const large = 300; | ||
} |
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,44 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:graphql_flutter/graphql_flutter.dart'; | ||
import 'package:talawa/constants/routing_constants.dart'; | ||
import 'package:talawa/enums/enums.dart'; | ||
import 'package:talawa/locator.dart'; | ||
import 'package:talawa/models/organization/org_info.dart'; | ||
import 'package:talawa/view_model/base_view_model.dart'; | ||
|
||
class AccessScreenViewModel extends BaseModel { | ||
late OrgInfo selectedOrganization = OrgInfo(id: '-1'); | ||
late List<OrgInfo> organizations = []; | ||
late String orgId; | ||
final optionalMessageController = TextEditingController(); | ||
|
||
Future<void> initialise(OrgInfo org) async { | ||
selectedOrganization = org; | ||
} | ||
|
||
Future<void> sendMembershipRequest() async { | ||
//TODO: Implement Message arg for below function | ||
final result = await databaseFunctions.gqlAuthMutation( | ||
queries.sendMembershipRequest(selectedOrganization.id!), | ||
); | ||
if (result != null) { | ||
final OrgInfo membershipRequest = OrgInfo.fromJson( | ||
(((result as QueryResult).data!)['sendMembershipRequest'] | ||
as Map<String, dynamic>)['organization'] as Map<String, dynamic>, | ||
); | ||
userConfig.updateUserMemberRequestOrg([membershipRequest]); | ||
if (userConfig.currentUser.joinedOrganizations!.isEmpty) { | ||
navigationService.removeAllAndPush( | ||
Routes.waitingScreen, | ||
Routes.splashScreen, | ||
); | ||
} else { | ||
navigationService.pop(); | ||
navigationService.showTalawaErrorSnackBar( | ||
'Join in request sent to ${selectedOrganization.name} successfully', | ||
MessageType.info, | ||
); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.