Skip to content

Commit

Permalink
Merge pull request #74 from Onix-Systems/dev
Browse files Browse the repository at this point in the history
update 1.1.1+26
  • Loading branch information
cozvtieg9 authored Jun 12, 2024
2 parents c8d7bfd + 7183a57 commit a597416
Show file tree
Hide file tree
Showing 113 changed files with 3,392 additions and 1,734 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ app.*.map.json

# generator config
.gen_config.json
/release/
/release/
/.fvm/
4 changes: 4 additions & 0 deletions assets/signing/signing.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
STORE_FILE=./signing/upload-keystore.jks
STORE_PASSWORD={signing_password}
KEY_ALIAS=upload
KEY_PASSWORD={signing_password}
43 changes: 31 additions & 12 deletions bricks/flutter_clean_base/hooks/post_gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const flavorizrInjectKey = '#{flavorizer_injection_config}';
void run(HookContext context) async {
name = context.vars['project_name'].toString().toSnakeCase;


if (!context.vars['platforms'].contains('android')) {
await Process.run('rm', ['-rf', '$name/android']);
}
Expand Down Expand Up @@ -377,10 +378,14 @@ $flavor:
Future<void> injectFlavors(HookContext context) async {
///START:Flavorizer config injection
final isFlavorized = context.vars['flavorizr'] as bool;
final isIOsEnabled = context.vars['platforms'].contains('ios') as bool;
final isAndroidEnabled = context.vars['platforms'].contains('android') as bool;
final isMacOsEnabled = context.vars['platforms'].contains('macos') as bool;
File pubspecFile = File('$name/pubspec.yaml');
if (!pubspecFile.existsSync()) return;
String pubspecFileContent = await pubspecFile.readAsString();
if (isFlavorized) {

final flavors = (context.vars['flavors'] as List)
.map(
(e) => e as String,
Expand All @@ -396,21 +401,33 @@ Future<void> injectFlavors(HookContext context) async {
lines.add(' flavors:');
for (String flavor in flavors) {
final packageSuffix = flavor.toLowerCase() == 'prod' ? '' : '.$flavor';
final nameSuffix = flavor.toLowerCase() == 'prod' ? '' : ' $flavor';
final nameSuffix = flavor.toLowerCase() == 'prod' ? '' : ' ${flavor.toTitleCase}';
lines.add(' $flavor:');
lines.add(' app:');
lines.add(' name: "$name$nameSuffix"');
lines.add('');
lines.add(' android:');
lines.add(' applicationId: "$org.$name$packageSuffix"');
lines.add(
' icon: "flavor_assets/$flavor/launcher_icons/ic_launcher.png"');
lines.add('');
lines.add(' ios:');
lines.add(' bundleId: "$org.$name$packageSuffix"');
lines.add(
' icon: "flavor_assets/$flavor/launcher_icons/ic_launcher.png"');
lines.add(' name: "${name.toTitleCase}$nameSuffix"');
lines.add('');
if(isAndroidEnabled){
lines.add(' android:');
lines.add(' applicationId: "$org.$name$packageSuffix"');
lines.add(
' icon: "flavor_assets/$flavor/launcher_icons/ic_launcher.png"');
lines.add('');
}
if(isIOsEnabled){
lines.add(' ios:');
lines.add(' bundleId: "$org.$name$packageSuffix"');
lines.add(
' icon: "flavor_assets/$flavor/launcher_icons/ic_launcher.png"');
lines.add('');
}
if(isMacOsEnabled){
lines.add(' macos:');
lines.add(' bundleId: "$org.$name$packageSuffix"');
lines.add(
' icon: "flavor_assets/$flavor/launcher_icons/ic_launcher.png"');
lines.add('');
}

lines.add('');
}
final flavorLines = lines.join('\n');
Expand Down Expand Up @@ -657,4 +674,6 @@ extension Case on String {
String get toCamelCase => ReCase(this).camelCase;

String get toPascalCase => ReCase(this).pascalCase;

String get toTitleCase => ReCase(this).titleCase;
}
60 changes: 27 additions & 33 deletions lib/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:loader_overlay/loader_overlay.dart';
import 'package:onix_flutter_bricks/app/bloc/app_bloc_imports.dart';
import 'package:onix_flutter_bricks/core/app/localization/generated/l10n.dart';
import 'package:onix_flutter_bricks/core/arch/bloc/base_block_state.dart';
import 'package:onix_flutter_bricks/core/router/app_router.dart';
import 'package:onix_flutter_bricks/presentation/style/theme/theme_imports.dart';

Expand All @@ -15,46 +13,42 @@ class App extends StatefulWidget {
State<App> createState() => _AppState();
}

class _AppState extends BaseState<AppScreenState, AppBloc, AppSR, App> {
class _AppState extends State<App> {
Locale? locale;

@override
Widget buildWidget(BuildContext context) {
Widget build(BuildContext context) {
AppRouter.init();
return GlobalLoaderOverlay(
useDefaultLoading: true,
overlayColor: Colors.black.withOpacity(0.5),
child: blocConsumer(
stateListener: (state) {
return MaterialApp.router(
debugShowCheckedModeBanner: false,
builder: (context, widget) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaler: TextScaler.noScaling,
),
child: widget ?? const SizedBox(),
);
},
scrollBehavior: const CupertinoScrollBehavior(),
title: '',
theme: createLightTheme(),
darkTheme: createDarkTheme(),
themeMode: ThemeMode.dark,
routeInformationProvider: AppRouter.router.routeInformationProvider,
routeInformationParser: AppRouter.router.routeInformationParser,
routerDelegate: AppRouter.router.routerDelegate,
locale: locale,
localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
onGenerateTitle: (context) => S.of(context).title,
child: MaterialApp.router(
debugShowCheckedModeBanner: false,
builder: (context, widget) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaler: TextScaler.noScaling,
),
child: widget ?? const SizedBox(),
);
},
scrollBehavior: const CupertinoScrollBehavior(),
title: '',
theme: createLightTheme(),
darkTheme: createDarkTheme(),
themeMode: ThemeMode.dark,
routeInformationProvider: AppRouter.router.routeInformationProvider,
routeInformationParser: AppRouter.router.routeInformationParser,
routerDelegate: AppRouter.router.routerDelegate,
locale: locale,
localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
onGenerateTitle: (context) => S.of(context).title,
),
);
}
Expand Down
19 changes: 0 additions & 19 deletions lib/app/bloc/app_bloc.dart

This file was deleted.

2 changes: 0 additions & 2 deletions lib/app/bloc/app_bloc_imports.dart

This file was deleted.

17 changes: 0 additions & 17 deletions lib/app/bloc/app_models.dart

This file was deleted.

Loading

0 comments on commit a597416

Please sign in to comment.