Skip to content

Commit

Permalink
Merge pull request #44 from wednesday-solutions/update_lib_and_configs
Browse files Browse the repository at this point in the history
Update lib and configs. Remove deprecated code.
  • Loading branch information
shounak-mulay authored Jul 29, 2023
2 parents b9da197 + d7b3430 commit 894c8c6
Show file tree
Hide file tree
Showing 32 changed files with 367 additions and 253 deletions.
8 changes: 8 additions & 0 deletions .idea/runConfigurations/dev.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/runConfigurations/dev_profile.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/runConfigurations/prod.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/runConfigurations/prod_profile.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/runConfigurations/prod_release.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/runConfigurations/qa.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/runConfigurations/qa_profile.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/runConfigurations/qa_release.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 28 additions & 2 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.

version:
revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b
revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
channel: stable

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- platform: linux
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- platform: macos
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- platform: windows
create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
67 changes: 62 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,74 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"name": "flutter_template",
"name": "dev",
"request": "launch",
"type": "dart"
"type": "dart",
"toolArgs": ["--dart-define=flavor=dev"],
"args": ["--flavor=dev"]
},
{
"name": "dev-profile",
"request": "launch",
"type": "dart",
"toolArgs": ["--dart-define=flavor=dev"],
"args": ["--flavor=dev"],
"flutterMode": "profile"
},
{
"name": "dev-release",
"request": "launch",
"type": "dart",
"toolArgs": ["--dart-define=flavor=dev"],
"args": ["--flavor=dev"],
"flutterMode": "release"
},
{
"name": "qa",
"request": "launch",
"type": "dart",
"toolArgs": ["--dart-define=flavor=qa"],
"args": ["--flavor=qa"]
},
{
"name": "flutter_template (profile mode)",
"name": "qa-profile",
"request": "launch",
"type": "dart",
"toolArgs": ["--dart-define=flavor=qa"],
"args": ["--flavor=qa"],
"flutterMode": "profile"
},
{
"name": "qa-release",
"request": "launch",
"type": "dart",
"toolArgs": ["--dart-define=flavor=qa"],
"args": ["--flavor=qa"],
"flutterMode": "release"
},
{
"name": "prod",
"request": "launch",
"type": "dart",
"toolArgs": ["--dart-define=flavor=prod"],
"args": ["--flavor=prod"]
},
{
"name": "prod-profile",
"request": "launch",
"type": "dart",
"toolArgs": ["--dart-define=flavor=prod"],
"args": ["--flavor=prod"],
"flutterMode": "profile"
},
{
"name": "prod-release",
"request": "launch",
"type": "dart",
"toolArgs": ["--dart-define=flavor=prod"],
"args": ["--flavor=prod"],
"flutterMode": "release"
}
]
}
}
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
2 changes: 1 addition & 1 deletion lib/foundation/logger/logger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class LogHelper {
final logger = Logger(
filter: _FlutterTemplateLogFilter(),
printer: PrettyPrinter(printEmojis: false),
level: Level.verbose,
level: Level.trace,
);

_instance = logger;
Expand Down
5 changes: 1 addition & 4 deletions lib/navigation/base/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ part 'app_router.gr.dart';
class AppRouter extends _$AppRouter {
@override
List<AutoRoute> get routes => [
AutoRoute(
path: HomeScreen.path,
page: HomeRoute.page,
),
AutoRoute(path: HomeScreen.path, page: HomeRoute.page, initial: true),
AutoRoute(
path: SearchScreen.path,
page: SearchRoute.page,
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/destinations/weather/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class HomePage extends ConsumerWidget {

const HomePage({
Key? key,
required this.homeScreen,
this.homeScreen = const HomeScreen(),
}) : super(key: key);

@override
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/intl/translations/translation_loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CodegenLoader extends AssetLoader {
const CodegenLoader();

@override
Future<Map<String, dynamic>> load(String fullPath, Locale locale) {
Future<Map<String, dynamic>?> load(String path, Locale locale) {
return Future.value(mapLocales[locale.toString()]);
}

Expand Down
14 changes: 1 addition & 13 deletions lib/presentation/template_app.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import 'package:dynamic_color/dynamic_color.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_template/flavors/flavor.dart';
import 'package:flutter_template/flavors/flavor_config.dart';
import 'package:flutter_template/navigation/base/app_router.dart';
import 'package:flutter_template/presentation/base/theme/theme_data/template_app_theme_data.dart';
import 'package:flutter_template/presentation/base/widgets/snackbar/snackbar.dart';
import 'package:flutter_template/presentation/base/widgets/theme/theme_listener.dart';
import 'package:flutter_template/presentation/destinations/weather/home/home_screen.dart';
import 'package:get_it/get_it.dart';

class TemplateApp extends StatelessWidget {
Expand All @@ -19,11 +15,6 @@ class TemplateApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
const enableDevicePreview =
String.fromEnvironment("enableDevicePreview") == "true";
final useDevicePreview =
enableDevicePreview && kDebugMode && FlavorConfig.flavor == Flavor.dev;

return ProviderScope(
child: ThemeStateListener(
builder: (themeState) => DynamicColorBuilder(
Expand All @@ -35,13 +26,10 @@ class TemplateApp extends StatelessWidget {
? buildTheme(darkDynamic.harmonized())
: material3DarkTheme;
return MaterialApp.router(
useInheritedMediaQuery: useDevicePreview,
theme: lightTheme,
darkTheme: darkTheme,
themeMode: themeState.themeMode,
routerDelegate: _appRouter.delegate(
initialRoutes: [HomeRoute(homeScreen: const HomeScreen())],
),
routerDelegate: _appRouter.delegate(),
routeInformationParser: _appRouter.defaultRouteParser(),
localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales,
Expand Down
Loading

0 comments on commit 894c8c6

Please sign in to comment.