From 5f372a6e24555d32b561966d1e5d20e47c6dd9b5 Mon Sep 17 00:00:00 2001 From: xue Date: Sat, 29 Jun 2024 08:34:40 +0300 Subject: [PATCH] refactor: Renamed package name `langx_flutter` with `langx` dependency order --- ios/Runner/Info.plist | 2 +- lib/components/profile/about_me_card.dart | 14 ++-- lib/components/profile/day_streaks_card.dart | 2 +- .../profile/mother_tongues_card.dart | 2 +- lib/components/profile/others_card.dart | 4 +- .../profile/study_languages_card.dart | 2 +- lib/components/profile/token_card.dart | 4 +- lib/main.dart | 8 +-- lib/pages/home/community.dart | 6 +- lib/pages/home/filters.dart | 10 +-- lib/pages/home/home.dart | 4 +- lib/pages/home/profile.dart | 18 ++--- lib/pages/login/login.dart | 8 +-- lib/providers/auth_provider.dart | 6 +- lib/providers/user_provider.dart | 2 +- lib/services/auth_service.dart | 2 +- lib/services/user_service.dart | 2 +- pubspec.yaml | 2 +- test/widget_test.dart | 2 +- web/index.html | 38 +++++------ web/manifest.json | 66 +++++++++---------- 21 files changed, 102 insertions(+), 102 deletions(-) diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 95f27fa..cbfdd1d 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - langx_flutter + langx CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/components/profile/about_me_card.dart b/lib/components/profile/about_me_card.dart index 445a19c..c0ceda7 100644 --- a/lib/components/profile/about_me_card.dart +++ b/lib/components/profile/about_me_card.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; // Components Import -import 'package:langx_flutter/assets/svg/info_svg.dart'; -import 'package:langx_flutter/assets/svg/country_svg.dart'; -import 'package:langx_flutter/assets/svg/gender_svg.dart'; -import 'package:langx_flutter/assets/svg/calendar_svg.dart'; -import 'package:langx_flutter/assets/svg/clock_svg.dart'; -import 'package:langx_flutter/assets/svg/at_sign_svg.dart'; -import 'package:langx_flutter/assets/svg/shield_svg.dart'; +import 'package:langx/assets/svg/info_svg.dart'; +import 'package:langx/assets/svg/country_svg.dart'; +import 'package:langx/assets/svg/gender_svg.dart'; +import 'package:langx/assets/svg/calendar_svg.dart'; +import 'package:langx/assets/svg/clock_svg.dart'; +import 'package:langx/assets/svg/at_sign_svg.dart'; +import 'package:langx/assets/svg/shield_svg.dart'; class ProfileAboutMeCard extends StatelessWidget { final String country; diff --git a/lib/components/profile/day_streaks_card.dart b/lib/components/profile/day_streaks_card.dart index 3ba7d38..5bd7b4c 100644 --- a/lib/components/profile/day_streaks_card.dart +++ b/lib/components/profile/day_streaks_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; // Components Imports -import 'package:langx_flutter/assets/svg/info_svg.dart'; +import 'package:langx/assets/svg/info_svg.dart'; class ProfileDayStreaksCard extends StatelessWidget { final String imgUrl; diff --git a/lib/components/profile/mother_tongues_card.dart b/lib/components/profile/mother_tongues_card.dart index aad38dc..d9fedc6 100644 --- a/lib/components/profile/mother_tongues_card.dart +++ b/lib/components/profile/mother_tongues_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; // Components Imports -import 'package:langx_flutter/assets/svg/word_svg.dart'; +import 'package:langx/assets/svg/word_svg.dart'; class MotherTonguesCard extends StatelessWidget { final List languages; diff --git a/lib/components/profile/others_card.dart b/lib/components/profile/others_card.dart index f29f966..ed12f14 100644 --- a/lib/components/profile/others_card.dart +++ b/lib/components/profile/others_card.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; // Components Imports -import 'package:langx_flutter/assets/svg/people_svg.dart'; -import 'package:langx_flutter/assets/svg/eye_svg.dart'; +import 'package:langx/assets/svg/people_svg.dart'; +import 'package:langx/assets/svg/eye_svg.dart'; class OthersCard extends StatelessWidget { const OthersCard({ diff --git a/lib/components/profile/study_languages_card.dart b/lib/components/profile/study_languages_card.dart index ccaa3fe..d2a7cd5 100644 --- a/lib/components/profile/study_languages_card.dart +++ b/lib/components/profile/study_languages_card.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; // Components Imports -import 'package:langx_flutter/assets/svg/battery_svg.dart'; +import 'package:langx/assets/svg/battery_svg.dart'; class StudyLanguagesCard extends StatelessWidget { final List languages; diff --git a/lib/components/profile/token_card.dart b/lib/components/profile/token_card.dart index 6ff84d5..9ba93aa 100644 --- a/lib/components/profile/token_card.dart +++ b/lib/components/profile/token_card.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; // Components Imports -import 'package:langx_flutter/assets/svg/trophy_svg.dart'; -import 'package:langx_flutter/assets/svg/info_svg.dart'; +import 'package:langx/assets/svg/trophy_svg.dart'; +import 'package:langx/assets/svg/info_svg.dart'; class ProfileTokenCard extends StatelessWidget { final String imgUrl; diff --git a/lib/main.dart b/lib/main.dart index 7750e4a..1ce42e0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,14 +4,14 @@ import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:toastification/toastification.dart'; // Themes Import -import 'package:langx_flutter/theme.dart'; +import 'package:langx/theme.dart'; // Pages Import -import 'package:langx_flutter/pages/login/login.dart'; -import 'package:langx_flutter/pages/home/home.dart'; +import 'package:langx/pages/login/login.dart'; +import 'package:langx/pages/home/home.dart'; // Providers Import -import 'package:langx_flutter/providers/auth_provider.dart'; +import 'package:langx/providers/auth_provider.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); diff --git a/lib/pages/home/community.dart b/lib/pages/home/community.dart index 9ce3741..e87ffb3 100644 --- a/lib/pages/home/community.dart +++ b/lib/pages/home/community.dart @@ -2,11 +2,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; // Components Import -import 'package:langx_flutter/components/community/usercard.dart'; -import 'package:langx_flutter/providers/user_provider.dart'; +import 'package:langx/components/community/usercard.dart'; +import 'package:langx/providers/user_provider.dart'; // Pages Import -import 'package:langx_flutter/pages/home/filters.dart'; +import 'package:langx/pages/home/filters.dart'; class Community extends ConsumerStatefulWidget { const Community({super.key}); diff --git a/lib/pages/home/filters.dart b/lib/pages/home/filters.dart index 1496ff3..80ac2af 100644 --- a/lib/pages/home/filters.dart +++ b/lib/pages/home/filters.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; -import 'package:langx_flutter/assets/svg/battery_svg.dart'; -import 'package:langx_flutter/assets/svg/word_svg.dart'; -import 'package:langx_flutter/assets/svg/country_svg.dart'; -import 'package:langx_flutter/assets/svg/sex_svg.dart'; -import 'package:langx_flutter/assets/svg/switch_svg.dart'; +import 'package:langx/assets/svg/battery_svg.dart'; +import 'package:langx/assets/svg/word_svg.dart'; +import 'package:langx/assets/svg/country_svg.dart'; +import 'package:langx/assets/svg/sex_svg.dart'; +import 'package:langx/assets/svg/switch_svg.dart'; class FiltersPage extends StatefulWidget { const FiltersPage({super.key}); diff --git a/lib/pages/home/home.dart b/lib/pages/home/home.dart index 1bb344b..cdab8a0 100644 --- a/lib/pages/home/home.dart +++ b/lib/pages/home/home.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; // Pages Import -import 'package:langx_flutter/pages/home/community.dart'; -import 'package:langx_flutter/pages/home/profile.dart'; +import 'package:langx/pages/home/community.dart'; +import 'package:langx/pages/home/profile.dart'; class Home extends StatefulWidget { const Home({super.key}); diff --git a/lib/pages/home/profile.dart b/lib/pages/home/profile.dart index 71d3399..87be809 100644 --- a/lib/pages/home/profile.dart +++ b/lib/pages/home/profile.dart @@ -2,17 +2,17 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; // Providers Import -import 'package:langx_flutter/providers/auth_provider.dart'; +import 'package:langx/providers/auth_provider.dart'; // Components Import -import 'package:langx_flutter/components/profile/user_card.dart'; -import 'package:langx_flutter/components/profile/token_card.dart'; -import 'package:langx_flutter/components/profile/day_streaks_card.dart'; -import 'package:langx_flutter/components/profile/about_me_card.dart'; -import 'package:langx_flutter/components/profile/study_languages_card.dart'; -import 'package:langx_flutter/components/profile/mother_tongues_card.dart'; -import 'package:langx_flutter/components/profile/badges_card.dart'; -import 'package:langx_flutter/components/profile/others_card.dart'; +import 'package:langx/components/profile/user_card.dart'; +import 'package:langx/components/profile/token_card.dart'; +import 'package:langx/components/profile/day_streaks_card.dart'; +import 'package:langx/components/profile/about_me_card.dart'; +import 'package:langx/components/profile/study_languages_card.dart'; +import 'package:langx/components/profile/mother_tongues_card.dart'; +import 'package:langx/components/profile/badges_card.dart'; +import 'package:langx/components/profile/others_card.dart'; class Profile extends ConsumerStatefulWidget { const Profile({super.key}); diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 43eba62..d272c46 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -4,12 +4,12 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; // Providers Import -import 'package:langx_flutter/providers/auth_provider.dart'; +import 'package:langx/providers/auth_provider.dart'; // Component Imports -import 'package:langx_flutter/components/atomic/dfault_buttons.dart'; -import 'package:langx_flutter/components/atomic/dfault_input.dart'; -import 'package:langx_flutter/components/atomic/oauth_button.dart'; +import 'package:langx/components/atomic/dfault_buttons.dart'; +import 'package:langx/components/atomic/dfault_input.dart'; +import 'package:langx/components/atomic/oauth_button.dart'; class LoginScreen extends ConsumerStatefulWidget { const LoginScreen({super.key}); diff --git a/lib/providers/auth_provider.dart b/lib/providers/auth_provider.dart index ecceeac..d38cf47 100644 --- a/lib/providers/auth_provider.dart +++ b/lib/providers/auth_provider.dart @@ -2,11 +2,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; // Service Imports -import 'package:langx_flutter/services/auth_service.dart'; +import 'package:langx/services/auth_service.dart'; // Page Imports -import 'package:langx_flutter/pages/home/home.dart'; -import 'package:langx_flutter/pages/login/login.dart'; +import 'package:langx/pages/home/home.dart'; +import 'package:langx/pages/login/login.dart'; // Define an enum for authentication state enum AuthStatus { authenticated, unauthenticated, loading, error } diff --git a/lib/providers/user_provider.dart b/lib/providers/user_provider.dart index 408de38..337cd8c 100644 --- a/lib/providers/user_provider.dart +++ b/lib/providers/user_provider.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; // Service Imports -import 'package:langx_flutter/services/user_service.dart'; +import 'package:langx/services/user_service.dart'; class UserNotifier extends StateNotifier> { UserNotifier() : super([]); diff --git a/lib/services/auth_service.dart b/lib/services/auth_service.dart index 8e15070..aed954b 100644 --- a/lib/services/auth_service.dart +++ b/lib/services/auth_service.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; // Service Imports -import 'package:langx_flutter/services/api_service.dart'; +import 'package:langx/services/api_service.dart'; Future isLoggedIn() async { try { diff --git a/lib/services/user_service.dart b/lib/services/user_service.dart index ce94361..5c32d0b 100644 --- a/lib/services/user_service.dart +++ b/lib/services/user_service.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; // Service Imports -import 'package:langx_flutter/services/api_service.dart'; +import 'package:langx/services/api_service.dart'; Future> listUsers() async { try { diff --git a/pubspec.yaml b/pubspec.yaml index 42e4b87..187414c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: langx_flutter +name: langx description: "We connect language learners worldwide. Practice and immerse yourself in different languages. " # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. diff --git a/test/widget_test.dart b/test/widget_test.dart index 15e6a2f..cbf2282 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -8,7 +8,7 @@ // import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -// import 'package:langx_flutter/main.dart'; +// import 'package:langx/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { diff --git a/web/index.html b/web/index.html index 459363e..f8f7edc 100644 --- a/web/index.html +++ b/web/index.html @@ -1,7 +1,7 @@ - - - + - - - + + + - - - - - + + + + + - - + + - langx_flutter - - - - - + langx + + + + + diff --git a/web/manifest.json b/web/manifest.json index 78ed759..5ec7a1c 100644 --- a/web/manifest.json +++ b/web/manifest.json @@ -1,35 +1,35 @@ { - "name": "langx_flutter", - "short_name": "langx_flutter", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] + "name": "langx", + "short_name": "langx", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] }