Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Usage of barrel Imports issue #347

Merged
merged 23 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
880b26c
centered monthly leaderboards
Uttkarsh-raj Jan 2, 2024
5313e91
monthly leaderboards alignment solved
Uttkarsh-raj Jan 3, 2024
0481411
added title and description to the issues
Uttkarsh-raj Jan 11, 2024
ab1bd59
Update general_endpoints.dart
Uttkarsh-raj Jan 11, 2024
3c5f659
Update report_bug.dart
DonnieBLT Jan 20, 2024
cbebfdb
Merge branch 'main' into main
DonnieBLT Jan 20, 2024
1ece64e
Update issue_detail.dart
DonnieBLT Jan 20, 2024
e399779
Update monthly_leaderboard.dart
DonnieBLT Jan 27, 2024
0db7851
Merge branch 'main' into main
DonnieBLT Jan 27, 2024
3a4ec8a
Update monthly_leaderboard.dart
DonnieBLT Jan 27, 2024
ee0e140
barrel imports
Uttkarsh-raj Feb 1, 2024
2438004
Merge branch 'OWASP:main' into main
Uttkarsh-raj Feb 2, 2024
1a4d0f8
imports
Uttkarsh-raj Feb 2, 2024
a1f7618
Merge branch 'main' into barrel-imports
Uttkarsh-raj Feb 23, 2024
756d5ff
Merge branch 'main' into barrel-imports
Uttkarsh-raj Feb 24, 2024
08faf9b
Merge branch 'main' into barrel-imports
Uttkarsh-raj Feb 24, 2024
890d8aa
Merge branch 'main' into barrel-imports
DonnieBLT Feb 24, 2024
d44f09c
app localisation + list view error solved
Uttkarsh-raj Feb 25, 2024
f6fddd8
Merge branch 'barrel-imports' of https://github.com/Uttkarsh-raj/BLT-…
Uttkarsh-raj Feb 25, 2024
88328db
removed debug statement
Uttkarsh-raj Feb 25, 2024
ea0fec6
Merge branch 'main' into barrel-imports
Uttkarsh-raj Feb 25, 2024
27703c0
dark mode provider added
Uttkarsh-raj Feb 26, 2024
18f18bf
unused import
Uttkarsh-raj Feb 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/src/components/appbar.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

import '../routes/routing.dart';
import '../components/searchbar.dart';
import '../global/variables.dart';
import 'package:blt/src/components/components_import.dart';

/// The app's main Appbar
AppBar buildAppBar({required BuildContext context}) {
Expand Down
22 changes: 22 additions & 0 deletions lib/src/components/components_import.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export 'package:blt/src/routes/routing.dart';
export 'package:flutter_svg/flutter_svg.dart';
export 'package:blt/src/components/searchbar.dart';
export 'package:blt/src/global/variables.dart';
export 'package:cached_network_image/cached_network_image.dart';
export 'package:flutter/services.dart';
export 'package:google_fonts/google_fonts.dart';
export 'package:url_launcher/url_launcher.dart';
export '../models/issue_model.dart';
export '../components/issuelike.dart';
export 'package:flutter_riverpod/flutter_riverpod.dart';
export '../providers/login_provider.dart';
export '../util/api/issues_api.dart';
export '../util/enums/login_type.dart';
export '../models/issuedata_model.dart';
export '../components/issue_intro_card.dart';
export 'package:blt/src/pages/welcome.dart';
export 'package:blt/src/components/onboarding/models/onboard_page_model.dart';
export 'package:blt/src/components/onboarding/components/drawer_paint.dart';
export 'package:blt/src/components/onboarding/components/onboard_page.dart';
export 'package:blt/src/components/onboarding/data/onboard_page_data.dart';
export 'package:smooth_page_indicator/smooth_page_indicator.dart';
16 changes: 7 additions & 9 deletions lib/src/components/contributor_card.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:blt/src/components/components_import.dart';

class ContributorCard extends StatelessWidget {
final Map<String, String> contributor;
Expand Down Expand Up @@ -78,8 +74,8 @@ class ContributorCard extends StatelessWidget {
tag: "image${contributor["id"]}",
child: CircleAvatar(
radius: 32,
backgroundImage:
CachedNetworkImageProvider(contributor["img"]!),
backgroundImage: CachedNetworkImageProvider(
contributor["img"]!),
),
),
),
Expand Down Expand Up @@ -233,10 +229,12 @@ class ContributorCard extends StatelessWidget {
),
IconButton(
onPressed: () async {
await Clipboard.setData(ClipboardData(text: contributor["bch_addr"]!));
await Clipboard.setData(ClipboardData(
text: contributor["bch_addr"]!));
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text("Bitcoin cash address copied to clipboard!"),
content: Text(
"Bitcoin cash address copied to clipboard!"),
),
);
},
Expand Down
7 changes: 1 addition & 6 deletions lib/src/components/issue_intro_card.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import '../routes/routing.dart';
import '../models/issue_model.dart';
import '../components/issuelike.dart';
import 'package:blt/src/components/components_import.dart';

/// The card used to display issues in the list of issues on the Issue Page.
class IssueCard extends StatelessWidget {
Expand Down
4 changes: 1 addition & 3 deletions lib/src/components/issuechip.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import '../models/issue_model.dart';
import 'package:blt/src/components/components_import.dart';

/// Chip that shows the open/close status of an issue.
class IssueStatusChip extends StatelessWidget {
Expand Down
7 changes: 1 addition & 6 deletions lib/src/components/issueflag.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import '../models/issue_model.dart';
import '../providers/login_provider.dart';
import '../util/api/issues_api.dart';
import '../util/enums/login_type.dart';
import 'package:blt/src/components/components_import.dart';

/// Issue flags show and toggle component.
class IssueFlagButton extends ConsumerStatefulWidget {
Expand Down
7 changes: 1 addition & 6 deletions lib/src/components/issuelike.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import '../models/issue_model.dart';
import '../util/api/issues_api.dart';
import '../util/enums/login_type.dart';
import '../providers/login_provider.dart';
import 'package:blt/src/components/components_import.dart';

/// Issue likes show and toggle component.
class IssueLikeButton extends ConsumerStatefulWidget {
Expand Down
6 changes: 2 additions & 4 deletions lib/src/components/onboarding/components/onboard_page.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:blt/src/components/components_import.dart';

import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import '../../../pages/welcome.dart';
import '../models/onboard_page_model.dart';
import 'drawer_paint.dart';

class OnboardPage extends StatefulWidget {
final PageController pageController;
Expand Down
3 changes: 1 addition & 2 deletions lib/src/components/onboarding/data/onboard_page_data.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:blt/src/components/components_import.dart';
import 'package:flutter/material.dart';

import '../models/onboard_page_model.dart';

List<OnboardPageModel> onboardData = [
OnboardPageModel(
Color(0xFFDC4654),
Expand Down
9 changes: 3 additions & 6 deletions lib/src/components/onboarding/onboarding.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import 'package:blt/src/components/components_import.dart';
import 'package:flutter/material.dart';
import '../../pages/welcome.dart';
import 'components/onboard_page.dart';
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
import 'data/onboard_page_data.dart';
import 'models/onboard_page_model.dart';

class Onboarding extends StatefulWidget {
final Map<String, String> stats;
Expand All @@ -20,7 +16,8 @@ class _OnboardingState extends State<Onboarding> {
@override
void initState() {
super.initState();
onboardData[2].description = '${widget.stats["bugs"]} Bugs\n${widget.stats["users"]} Users\n${widget.stats["hunts"]} Hunts\n${widget.stats["domains"]} Domains';
onboardData[2].description =
'${widget.stats["bugs"]} Bugs\n${widget.stats["users"]} Users\n${widget.stats["hunts"]} Hunts\n${widget.stats["domains"]} Domains';
}

@override
Expand Down
6 changes: 1 addition & 5 deletions lib/src/components/searchbar.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import 'package:blt/src/components/components_import.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import '../util/api/issues_api.dart';
import '../models/issuedata_model.dart';
import '../components/issue_intro_card.dart';

/// The search bar of app for searching issues based on keyword.
class BLTSearchDelegate extends SearchDelegate {
Expand Down
5 changes: 1 addition & 4 deletions lib/src/pages/auth/forgot.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import 'package:blt/src/util/api/auth_api.dart';
import 'package:blt/src/pages/pages_import.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

/// Page for initiating the process for recovering
/// a user's account password.
Expand Down
7 changes: 1 addition & 6 deletions lib/src/pages/auth/login.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import 'package:blt/src/providers/authstate_provider.dart';
import 'package:blt/src/routes/routing.dart';
import 'package:blt/src/pages/pages_import.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

/// The login page for the app.
class LoginPage extends StatefulWidget {
Expand Down
6 changes: 1 addition & 5 deletions lib/src/pages/auth/signup.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import 'package:blt/src/util/api/auth_api.dart';
import 'package:blt/src/pages/pages_import.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

import '../../routes/routing.dart';

/// The signup page for the app.
class SignUpPage extends StatefulWidget {
Expand Down
7 changes: 2 additions & 5 deletions lib/src/pages/company_details.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:blt/src/pages/pages_import.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../models/company_model.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';


/// Popup page for viewing company details when a company
/// is clicked on the Company Scoreboard page.
Expand Down
8 changes: 1 addition & 7 deletions lib/src/pages/drawer/about.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import 'package:blt/src/components/contributor_card.dart';
import 'package:blt/src/constants/about_constants.dart';
import 'package:blt/src/util/api/general_api.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:blt/src/pages/pages_import.dart';

/// Page for describing the BLT project.
class AboutPage extends StatelessWidget {
Expand Down
7 changes: 1 addition & 6 deletions lib/src/pages/drawer/change_password.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import 'package:blt/src/util/api/auth_api.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

//import '../../routes/routing.dart';
import '../pages_import.dart';

/// The change password page for the app.
class ChangePasswordPage extends StatefulWidget {
Expand Down
4 changes: 1 addition & 3 deletions lib/src/pages/drawer/company_dashboard.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../pages_import.dart';

class CompanyDashBoardPage extends ConsumerStatefulWidget {
const CompanyDashBoardPage({Key? key}) : super(key: key);
Expand Down
13 changes: 13 additions & 0 deletions lib/src/pages/drawer/drawer_imports.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export 'package:blt/src/components/contributor_card.dart';
export 'package:blt/src/constants/about_constants.dart';
export 'package:blt/src/util/api/general_api.dart';
export 'package:cached_network_image/cached_network_image.dart';
export 'package:flutter_svg/flutter_svg.dart';
export 'package:google_fonts/google_fonts.dart';
export 'package:blt/src/util/api/auth_api.dart';
export 'package:flutter_riverpod/flutter_riverpod.dart';
export 'package:flutter/services.dart';
export 'package:flutter_markdown/flutter_markdown.dart';
export 'package:font_awesome_flutter/font_awesome_flutter.dart';
export 'package:url_launcher/url_launcher.dart';
export '../../constants/socialurls_constants.dart';
7 changes: 2 additions & 5 deletions lib/src/pages/drawer/legal.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../pages_import.dart';


/// Page stating the legal Terms and Conditions and Privacy
/// Policy applying to the BLT project.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/pages/drawer/referral.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:blt/src/pages/pages_import.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';


/// Page for allowing users to send referrals to their friends.
class ReferralPage extends StatefulWidget {
Expand Down
8 changes: 2 additions & 6 deletions lib/src/pages/drawer/social.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import 'package:blt/src/pages/pages_import.dart';
import 'package:flutter/material.dart';
//import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../constants/socialurls_constants.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';


class SocialPage extends ConsumerStatefulWidget {
const SocialPage({Key? key}) : super(key: key);
Expand Down
6 changes: 2 additions & 4 deletions lib/src/pages/error.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:blt/src/routes/routing.dart';
import 'package:blt/src/pages/pages_import.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';


/// This page is thrown in case when a Navigation exception occurs.
class ErrorPage extends StatelessWidget {
Expand Down
5 changes: 1 addition & 4 deletions lib/src/pages/home/feed.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import 'package:blt/src/pages/pages_import.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

import '../../global/variables.dart';

/// Page for showing social activity of BLT, new issues,
/// top premium subscribers.
Expand Down
40 changes: 40 additions & 0 deletions lib/src/pages/home/home_imports.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export 'package:google_fonts/google_fonts.dart';
export 'package:flutter_riverpod/flutter_riverpod.dart';
export '../../global/variables.dart';
export 'package:blt/src/pages/home/issues.dart';
export 'package:blt/src/pages/home/leaderboard.dart';
export 'package:blt/src/pages/home/report_bug.dart';
export 'package:blt/src/pages/home/start_hunt.dart';
export 'package:blt/src/providers/authstate_provider.dart';
export 'package:blt/src/providers//dark_mode_provider.dart';
export 'package:blt/src/providers/login_provider.dart';
export 'package:blt/src/routes/routing.dart';
export 'package:blt/src/util/enums/login_type.dart';
export 'package:cached_network_image/cached_network_image.dart';
export 'package:receive_sharing_intent/receive_sharing_intent.dart';
export '../../components/appbar.dart';
export '../../pages/welcome.dart';
export 'package:blt/src/providers/issuelist_provider.dart';
export '../../components/issue_intro_card.dart';
export '../../models/issue_model.dart';
export '../../util/endpoints/issue_endpoints.dart';
export '../../constants/monthname_constants.dart';
export '../../providers/leaderboards/globalleaderboard_povider.dart';
export '../../providers/leaderboards/monthlyleaderboard_provider.dart';
export '../../providers/leaderboards/companyscoreboard_provider.dart';
export 'package:blt/src/util/api/user_api.dart';
export 'package:image_picker/image_picker.dart';
export '../../models/user_model.dart';
export '../../util/api/issues_api.dart';
export '../../components/issuechip.dart';
export '../../models/issuedata_model.dart';
export 'dart:io';
export 'dart:math';
export 'package:blt/src/util/api/general_api.dart';
export 'package:blt/src/util/endpoints/general_endpoints.dart';
export 'package:flutter/gestures.dart';
export 'package:flutter_svg/flutter_svg.dart';
export 'package:url_launcher/url_launcher.dart';
export 'package:flutter_markdown/flutter_markdown.dart';
export 'package:pasteboard/pasteboard.dart';
export 'package:flutter_gen/gen_l10n/app_localizations.dart';
11 changes: 1 addition & 10 deletions lib/src/pages/home/issues.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import 'package:blt/src/providers/dark_mode_provider.dart';
import 'package:blt/src/providers/issuelist_provider.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

import '../../components/issue_intro_card.dart';
import 'package:blt/src/pages/home/home_imports.dart';
import 'package:flutter/material.dart';

import '../../models/issue_model.dart';
import '../../util/endpoints/issue_endpoints.dart';

/// Issues page for viewing all the issues posted via the website and app.
class IssuesPage extends ConsumerStatefulWidget {
const IssuesPage({Key? key}) : super(key: key);
Expand Down
10 changes: 1 addition & 9 deletions lib/src/pages/home/leaderboard.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:blt/src/pages/home/home_imports.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../constants/monthname_constants.dart';
import '../../routes/routing.dart';
import '../../providers/leaderboards/globalleaderboard_povider.dart';
import '../../providers/leaderboards/monthlyleaderboard_provider.dart';
import '../../providers/leaderboards/companyscoreboard_provider.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

/// The Leaderboards dashboard page, contains the Global,
/// Monthly leaderboard, and Company Scoreboard.
Expand Down
Loading
Loading