Skip to content

Commit

Permalink
chore: fix lints and update project
Browse files Browse the repository at this point in the history
  • Loading branch information
xsahil03x committed Feb 12, 2025
1 parent 11a4f84 commit 83d8fbf
Show file tree
Hide file tree
Showing 41 changed files with 578 additions and 645 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ Podfile.lock
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3

# macOS-related
**/macos/**/Pods/
**/macos/**/xcuserdata
**/macos/**/Flutter/ephemeral

# Windows-related
**/windows/flutter/ephemeral/

# Linux-related
**/linux/flutter/ephemeral/

# Generated files
*.dart.js
*.info.json
Expand Down
46 changes: 0 additions & 46 deletions sample_app/.gitignore

This file was deleted.

30 changes: 4 additions & 26 deletions sample_app/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
include: ../analysis_options.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
cascade_invocations: false
public_member_api_docs: false
lines_longer_than_80_chars: false
7 changes: 0 additions & 7 deletions sample_app/android/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions sample_app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (flutterVersionName == null) {
android {
namespace "com.example.example"

compileSdkVersion 34
compileSdkVersion 35

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -40,7 +40,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
minSdkVersion 22
minSdkVersion 23
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
32 changes: 0 additions & 32 deletions sample_app/ios/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions sample_app/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ target 'Runner' do
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
Expand Down
2 changes: 2 additions & 0 deletions sample_app/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@
"${BUILT_PRODUCTS_DIR}/package_info_plus/package_info_plus.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework",
"${BUILT_PRODUCTS_DIR}/photo_manager/photo_manager.framework",
"${BUILT_PRODUCTS_DIR}/record_darwin/record_darwin.framework",
"${BUILT_PRODUCTS_DIR}/screen_brightness_ios/screen_brightness_ios.framework",
"${BUILT_PRODUCTS_DIR}/sentry_flutter/sentry_flutter.framework",
"${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework",
Expand Down Expand Up @@ -319,6 +320,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info_plus.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/photo_manager.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/record_darwin.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/screen_brightness_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sentry_flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework",
Expand Down
27 changes: 12 additions & 15 deletions sample_app/lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import 'dart:async';

import 'package:sample_app/pages/choose_user_page.dart';
import 'package:sample_app/pages/splash_screen.dart';
import 'package:sample_app/routes/app_routes.dart';
import 'package:sample_app/routes/routes.dart';
import 'package:sample_app/state/init_data.dart';
import 'package:sample_app/utils/app_config.dart';
import 'package:sample_app/utils/local_notification_observer.dart';
import 'package:sample_app/utils/localizations.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart';
Expand All @@ -16,14 +8,21 @@ import 'package:flutter/scheduler.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:sample_app/firebase_options.dart';
import 'package:sample_app/pages/choose_user_page.dart';
import 'package:sample_app/pages/splash_screen.dart';
import 'package:sample_app/routes/app_routes.dart';
import 'package:sample_app/routes/routes.dart';
import 'package:sample_app/state/init_data.dart';
import 'package:sample_app/utils/app_config.dart';
import 'package:sample_app/utils/local_notification_observer.dart';
import 'package:sample_app/utils/localizations.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
import 'package:stream_chat_localizations/stream_chat_localizations.dart';
import 'package:stream_chat_persistence/stream_chat_persistence.dart';
import 'package:streaming_shared_preferences/streaming_shared_preferences.dart';

import 'firebase_options.dart';

/// Constructs callback for background notification handling.
///
/// Will be invoked from another Isolate, that's why it's required to
Expand Down Expand Up @@ -84,7 +83,6 @@ Future<void> _onFirebaseBackgroundMessage(RemoteMessage message) async {

final chatPersistentClient = StreamChatPersistenceClient(
logLevel: Level.SEVERE,
connectionMode: ConnectionMode.regular,
);

void _sampleAppLogHandler(LogRecord record) async {
Expand Down Expand Up @@ -177,12 +175,11 @@ class _StreamChatSampleAppState extends State<StreamChatSampleApp>
final token = await FirebaseMessaging.instance.getToken();
debugPrint('[onTokenInit] #firebase; token: $token');
if (token != null) {
// replace with your push provider name, e.g., 'chat-flutter-firebase'
const pushProviderName = null;
// replace with your push provider, e.g., 'PushProvider.xiaomi'
const pushProvider = PushProvider.firebase;

// add Token to Stream
await client.addDevice(token, PushProvider.firebase,
pushProviderName: pushProviderName);
await client.addDevice(token, pushProvider);
}
}
// User logged out
Expand Down
7 changes: 3 additions & 4 deletions sample_app/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import 'dart:async';

import 'package:sample_app/app.dart';
import 'package:sample_app/utils/app_config.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:sample_app/app.dart';
import 'package:sample_app/firebase_options.dart';
import 'package:sample_app/utils/app_config.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

import 'firebase_options.dart';

Future<void> main() async {
/// Captures errors reported by the Flutter framework.
FlutterError.onError = (FlutterErrorDetails details) {
Expand Down
26 changes: 12 additions & 14 deletions sample_app/lib/pages/advanced_options_page.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import 'package:sample_app/app.dart';
import 'package:sample_app/state/init_data.dart';
import 'package:sample_app/utils/localizations.dart';
import 'package:sample_app/routes/routes.dart';
import 'package:sample_app/widgets/stream_version.dart';
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';

import 'package:sample_app/app.dart';
import 'package:sample_app/pages/choose_user_page.dart';
import 'package:sample_app/routes/routes.dart';
import 'package:sample_app/state/init_data.dart';
import 'package:sample_app/utils/localizations.dart';
import 'package:sample_app/widgets/stream_version.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';

class AdvancedOptionsPage extends StatefulWidget {
const AdvancedOptionsPage({super.key});
Expand Down Expand Up @@ -137,9 +136,8 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis),
),
leading: IconButton(
icon: StreamSvgIcon.left(
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
),
icon: const StreamSvgIcon(icon: StreamSvgIcons.left),
color: StreamChatTheme.of(context).colorTheme.textHighEmphasis,
onPressed: () {
Navigator.pop(context);
},
Expand Down Expand Up @@ -327,16 +325,16 @@ class _AdvancedOptionsPageState extends State<AdvancedOptionsPage> {
const Spacer(),
ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(
backgroundColor: WidgetStateProperty.all<Color>(
Theme.of(context).brightness == Brightness.light
? StreamChatTheme.of(context)
.colorTheme
.accentPrimary
: Colors.white),
elevation: MaterialStateProperty.all<double>(0),
padding: MaterialStateProperty.all<EdgeInsets>(
elevation: WidgetStateProperty.all<double>(0),
padding: WidgetStateProperty.all<EdgeInsets>(
const EdgeInsets.symmetric(vertical: 16)),
shape: MaterialStateProperty.all(
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26),
),
Expand Down
Loading

0 comments on commit 83d8fbf

Please sign in to comment.