Skip to content

Commit

Permalink
change pACKAGE NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdaslam790 committed Apr 9, 2024
1 parent 918c87a commit 6186a73
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 34 deletions.
10 changes: 10 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,19 @@ dart_code_metrics:
metrics-exclude:
- test/**
rules:
- avoid-dynamic
- avoid-passing-async-when-sync-expected
- avoid-redundant-async
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-unused-parameters
- avoid-nested-conditional-expressions
- newline-before-return
- no-boolean-literal-compare
- no-empty-block
- prefer-trailing-comma
- prefer-conditional-expressions
- no-equal-then-else
- prefer-moving-to-variable
- prefer-match-file-name
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.new.package.name"
applicationId "com.example.flutter_template"
minSdkVersion 24
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.new.package.name">
package="com.example.flutter_template">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.new.package.name">
package="com.example.flutter_template">

<!-- List of all possible permissions supported. Disable which are not required by the application to pass play store review. -->
<!--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.new.package.name
package com.example.flutter_template

import io.flutter.embedding.android.FlutterActivity

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.new.package.name">
package="com.example.flutter_template">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
2 changes: 1 addition & 1 deletion dev_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ flutter pub run flutter_launcher_icons
# Generates freezed files, assets paths
flutter pub run build_runner build --delete-conflicting-outputs
# Run to change the app package name
flutter pub run change_app_package_name:main com.new.package.name
flutter pub run change_app_package_name:main com.example.flutter_template
# Generates the splash screen from
flutter pub run flutter_native_splash:create
32 changes: 18 additions & 14 deletions lib/domain/core/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,17 @@ import 'app_localizations_es.dart';
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
/// property.
abstract class AppLocalizations {
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
AppLocalizations(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());

final String localeName;

static AppLocalizations of(BuildContext context) {
return Localizations.of<AppLocalizations>(context, AppLocalizations)!;
}

static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();
static const LocalizationsDelegate<AppLocalizations> delegate =
_AppLocalizationsDelegate();

/// A list of this localizations delegate along with the default localizations
/// delegates.
Expand All @@ -80,7 +82,8 @@ abstract class AppLocalizations {
/// Additional delegates can be added by appending to this list in
/// MaterialApp. This list does not have to be used at all if a custom list
/// of delegates is preferred or required.
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
<LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
Expand Down Expand Up @@ -202,7 +205,8 @@ abstract class AppLocalizations {
String get enterAValidPostalCode;
}

class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
class _AppLocalizationsDelegate
extends LocalizationsDelegate<AppLocalizations> {
const _AppLocalizationsDelegate();

@override
Expand All @@ -211,25 +215,25 @@ class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations>
}

@override
bool isSupported(Locale locale) => <String>['en', 'es'].contains(locale.languageCode);
bool isSupported(Locale locale) =>
<String>['en', 'es'].contains(locale.languageCode);

@override
bool shouldReload(_AppLocalizationsDelegate old) => false;
}

AppLocalizations lookupAppLocalizations(Locale locale) {


// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'en': return AppLocalizationsEn();
case 'es': return AppLocalizationsEs();
case 'en':
return AppLocalizationsEn();
case 'es':
return AppLocalizationsEs();
}

throw FlutterError(
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.'
);
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.');
}
17 changes: 11 additions & 6 deletions lib/domain/core/l10n/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'app_localizations.dart';

/// The translations for English (`en`).
class AppLocalizationsEn extends AppLocalizations {
AppLocalizationsEn([String locale = 'en']) : super(locale);
AppLocalizationsEn([super.locale = 'en']);

@override
String get thisFieldIsRequired => 'This field is required';
Expand All @@ -11,22 +11,26 @@ class AppLocalizationsEn extends AppLocalizations {
String get pleaseEnterAnEmailAddress => 'Please enter an email address';

@override
String get pleaseEnterAValidEmailAddress => 'Please enter a valid email address';
String get pleaseEnterAValidEmailAddress =>
'Please enter a valid email address';

@override
String get thisFieldCannotExceed100characters => 'This field cannot exceed 100 characters';
String get thisFieldCannotExceed100characters =>
'This field cannot exceed 100 characters';

@override
String get pleaseEnterAPhoneNumber => 'Please enter a phone number';

@override
String get pleaseEnterAValidPhoneNumber => 'Please enter a valid phone number';
String get pleaseEnterAValidPhoneNumber =>
'Please enter a valid phone number';

@override
String get pleaseEnterAPassword => 'Please enter a password';

@override
String get passwordTooShort => 'Password too short. Please enter a password of atleast 6 length';
String get passwordTooShort =>
'Password too short. Please enter a password of atleast 6 length';

@override
String get dontForgetYourName => 'Don’t forget your name!';
Expand All @@ -44,7 +48,8 @@ class AppLocalizationsEn extends AppLocalizations {
String get pleaseEnterValidDecimal => 'Please enter a valid decimal value';

@override
String get maximumAmountCannotExceed => 'Maximum amount cannot exceed 100,000';
String get maximumAmountCannotExceed =>
'Maximum amount cannot exceed 100,000';

@override
String get validIntegerValue => 'Please enter a valid integer value';
Expand Down
23 changes: 15 additions & 8 deletions lib/domain/core/l10n/app_localizations_es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,37 @@ import 'app_localizations.dart';

/// The translations for Spanish Castilian (`es`).
class AppLocalizationsEs extends AppLocalizations {
AppLocalizationsEs([String locale = 'es']) : super(locale);
AppLocalizationsEs([super.locale = 'es']);

@override
String get thisFieldIsRequired => 'Este espacio es requerido';

@override
String get pleaseEnterAnEmailAddress => 'Por favor, ingresa tu correo electrónico';
String get pleaseEnterAnEmailAddress =>
'Por favor, ingresa tu correo electrónico';

@override
String get pleaseEnterAValidEmailAddress => 'Por favor, ingresa un correo electrónico valido';
String get pleaseEnterAValidEmailAddress =>
'Por favor, ingresa un correo electrónico valido';

@override
String get thisFieldCannotExceed100characters => 'Este espacio no puede exceder los 100 carácteres';
String get thisFieldCannotExceed100characters =>
'Este espacio no puede exceder los 100 carácteres';

@override
String get pleaseEnterAPhoneNumber => 'Por favor, ingresa tu número de teléfono';
String get pleaseEnterAPhoneNumber =>
'Por favor, ingresa tu número de teléfono';

@override
String get pleaseEnterAValidPhoneNumber => 'Por favor, ingresa un número de teléfono valido';
String get pleaseEnterAValidPhoneNumber =>
'Por favor, ingresa un número de teléfono valido';

@override
String get pleaseEnterAPassword => 'Por favor, ingresa una contraseña';

@override
String get passwordTooShort => 'Contraseña muy corta. Por favor, ingresa una contraseña con al menos 6 carácteres';
String get passwordTooShort =>
'Contraseña muy corta. Por favor, ingresa una contraseña con al menos 6 carácteres';

@override
String get dontForgetYourName => '¡No te olvides de tu nombre!';
Expand All @@ -44,7 +50,8 @@ class AppLocalizationsEs extends AppLocalizations {
String get pleaseEnterValidDecimal => 'Introduce un número decimal valido';

@override
String get maximumAmountCannotExceed => 'El monto máximo no puede ser mayor a 100,000';
String get maximumAmountCannotExceed =>
'El monto máximo no puede ser mayor a 100,000';

@override
String get validIntegerValue => 'Introduce un valor entero valido';
Expand Down

0 comments on commit 6186a73

Please sign in to comment.