social_foundation 0.0.15

  • Readme
  • Changelog
  • Example
  • Installing
  • 21

social_foundation #

social foundation

0.0.15 #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:bot_toast/bot_toast.dart';
import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:social_foundation/social_foundation.dart';
import 'package:social_foundation_example/states/app_state.dart';
import 'package:social_foundation_example/states/user_state.dart';

import 'services/provider_manager.dart';
import 'config.dart';
import 'services/chat_manager.dart';
import 'services/router_manager.dart';
import 'services/storage_manager.dart';
import 'states/chat_state.dart';

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: providers,
      child: Consumer<AppState>(
        builder: (context,appState,child) => RefreshConfiguration(
          shouldFooterFollowWhenNotFull: (status) => false,
          child: BotToastInit(
            child: MaterialApp(
              title: 'social foundation',
              theme: appState.themeData(),
              darkTheme: appState.themeData(platformDarkMode:true),
              localizationsDelegates: [
                RefreshLocalizations.delegate
              ],
              navigatorObservers: [RouterManager.instance,BotToastNavigatorObserver()],
              onGenerateRoute: RouterManager.instance.generateRoute,
              initialRoute: RouteName.Signin,
            ),
          )
        )
      )
    );
  }
}

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  configureServices();
  await configure();
  runApp(App());
}

void configureServices(){
  GetIt.instance.registerSingleton(EventBus());
  GetIt.instance.registerSingleton<SfStorageManager>(StorageManager());
  GetIt.instance.registerSingleton<SfRouterManager>(RouterManager());
  GetIt.instance.registerSingleton<SfAppState>(AppState());
  GetIt.instance.registerSingleton<SfUserState>(UserState());
  GetIt.instance.registerSingleton<SfChatState>(ChatState());
  GetIt.instance.registerSingleton<SfChatManager>(ChatManager(LeancloudSecret.appId, LeancloudSecret.appKey, LeancloudSecret.serverURL));
}

Future<void> configure() async {
  await StorageManager.instance.init();
  SfAliyunOss.initialize(AliyunSecret.accountId,AliyunSecret.accessKeyId,AliyunSecret.accessKeySecret,AliyunSecret.region,AliyunSecret.bucket);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  social_foundation: ^0.0.15

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:social_foundation/social_foundation.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
56
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
20
Overall:
Weighted score of the above. [more]
21
Learn more about scoring.

We analyzed this package on May 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.1
  • pana: 0.13.8-dev
  • Flutter: 1.17.0

Health issues and suggestions

Fix lib/widgets/cached_image_provider.dart. (-44.03 points)

Analysis of lib/widgets/cached_image_provider.dart failed with 2 errors, 1 hint:

line 9 col 7: Missing concrete implementations of 'CachedNetworkImageProvider.load', 'ImageProvider.obtainKey', 'getter CachedNetworkImageProvider.cacheManager', 'getter CachedNetworkImageProvider.errorListener', and 3 more.

line 10 col 39: The generative constructor 'CachedNetworkImageProvider CachedNetworkImageProvider(String url, {double scale, void Function() errorListener, Map<String, String> headers, BaseCacheManager cacheManager})' expected, but factory found.

line 20 col 34: 'fileFetcher' is deprecated and shouldn't be used. Use FileService instead.

Format lib/models/conversation.dart.

Run flutter format to format lib/models/conversation.dart.

Format lib/models/message.dart.

Run flutter format to format lib/models/message.dart.

Fix additional 29 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/models/user.dart (Run flutter format to format lib/models/user.dart.)
  • lib/pages/photo_viewer.dart (Run flutter format to format lib/pages/photo_viewer.dart.)
  • lib/services/chat_manager.dart (Run flutter format to format lib/services/chat_manager.dart.)
  • lib/services/event_manager.dart (Run flutter format to format lib/services/event_manager.dart.)
  • lib/services/request_manager.dart (Run flutter format to format lib/services/request_manager.dart.)
  • lib/services/router_manager.dart (Run flutter format to format lib/services/router_manager.dart.)
  • lib/services/storage_manager.dart (Run flutter format to format lib/services/storage_manager.dart.)
  • lib/social_foundation.dart (Run flutter format to format lib/social_foundation.dart.)
  • lib/states/app_state.dart (Run flutter format to format lib/states/app_state.dart.)
  • lib/states/chat_state.dart (Run flutter format to format lib/states/chat_state.dart.)
  • lib/states/user_state.dart (Run flutter format to format lib/states/user_state.dart.)
  • lib/utils/aliyun_oss.dart (Run flutter format to format lib/utils/aliyun_oss.dart.)
  • lib/utils/date_helper.dart (Run flutter format to format lib/utils/date_helper.dart.)
  • lib/utils/file_helper.dart (Run flutter format to format lib/utils/file_helper.dart.)
  • lib/utils/utils.dart (Run flutter format to format lib/utils/utils.dart.)
  • lib/view_models/audio_model.dart (Run flutter format to format lib/view_models/audio_model.dart.)
  • lib/view_models/chat_model.dart (Run flutter format to format lib/view_models/chat_model.dart.)
  • lib/widgets/audio_widget.dart (Run flutter format to format lib/widgets/audio_widget.dart.)
  • lib/widgets/avatar.dart (Run flutter format to format lib/widgets/avatar.dart.)
  • lib/widgets/badge.dart (Run flutter format to format lib/widgets/badge.dart.)
  • lib/widgets/chat_input.dart (Run flutter format to format lib/widgets/chat_input.dart.)
  • lib/widgets/dialog.dart (Run flutter format to format lib/widgets/dialog.dart.)
  • lib/widgets/image_picker.dart (Run flutter format to format lib/widgets/image_picker.dart.)
  • lib/widgets/keep_alive.dart (Run flutter format to format lib/widgets/keep_alive.dart.)
  • lib/widgets/page_route.dart (Run flutter format to format lib/widgets/page_route.dart.)
  • lib/widgets/provider_widget.dart (Run flutter format to format lib/widgets/provider_widget.dart.)
  • lib/widgets/rolling_number.dart (Run flutter format to format lib/widgets/rolling_number.dart.)
  • lib/widgets/user_widget.dart (Run flutter format to format lib/widgets/user_widget.dart.)
  • lib/widgets/view_state.dart (Run flutter format to format lib/widgets/view_state.dart.)

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

Support latest dependencies. (-30 points)

The version constraint in pubspec.yaml does not support the latest published versions for 3 dependencies (audioplayers, bot_toast, get_it).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
audioplayers ^0.14.0 0.14.2 0.15.1
bot_toast ^2.3.0 2.4.1 3.0.0
cached_network_image ^2.0.0 2.2.0+1 2.3.0-beta
crypto ^2.1.3 2.1.5
dio ^3.0.9 3.0.9
event_bus ^1.1.1 1.1.1
flutter 0.0.0
flutter_cache_manager ^1.1.3 1.2.2
flutter_plugin_record ^0.1.2 0.1.5
flutter_screenutil ^1.1.0 1.1.0
get_it ^3.1.0 3.1.0 4.0.2
http ^0.12.0+4 0.12.1
image_picker ^0.6.3+4 0.6.6+5
leancloud_official_plugin ^1.0.0-beta.2 1.0.0-beta.4
path ^1.6.4 1.7.0
path_provider ^1.6.0 1.6.9
photo_view ^0.9.2 0.9.2
provider ^4.0.4 4.1.2
pull_to_refresh ^1.5.8 1.5.8
shared_preferences ^0.5.6+3 0.5.7+3
sqflite ^1.2.0 1.3.0+2
uuid ^2.0.4 2.0.4
Transitive dependencies
charcode 1.1.3
clock 1.0.1
collection 1.14.12
convert 2.1.1
file 5.1.0
flutter_plugin_android_lifecycle 1.0.8
flutter_web_plugins 0.0.0
http_parser 3.1.4
image_picker_platform_interface 1.0.0 1.1.0
intl 0.16.1
meta 1.1.8
nested 0.0.4
path_provider_macos 0.0.4+3
path_provider_platform_interface 1.0.2
pedantic 1.9.0
platform 2.2.1
plugin_platform_interface 1.0.2
rxdart 0.24.1
shared_preferences_macos 0.0.1+9
shared_preferences_platform_interface 1.0.4
shared_preferences_web 0.1.2+7
sky_engine 0.0.99
source_span 1.7.0
sqflite_common 1.0.1
string_scanner 1.0.5
synchronized 2.2.0
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test