yun_base 0.0.14

  • Readme
  • Changelog
  • Example
  • Installing
  • 43

yun_base #

base utils for flutter app by yun

Getting Started #

add dependencies:

  yun_base: any

How to use #

There are many categories,They are:

Config #

Global configuration and category configuration

Action #

Alert #

Http #

Log #

Model #

Page #

Toast #

Util #

0.0.14 - 2020-05-13 #

1、修改 YunRstDataDefine

0.0.13 - 2020-05-13 #

1、修改 toast (macOs 异常) 2、替换 platform(web 异常)

0.0.12 - 2020-04-28 #

1、修改YunRspData的返回值泛型 2、增加 alert 方法

0.0.11 - 2020-04-27 #

1、修改YunRspData的返回值泛型

0.0.10 - 2020-04-27 #

1、修改YunRspData的返回值泛型

0.0.9 - 2020-04-27 #

1、修改YunRspData的返回值泛型

0.0.8 - 2020-03-13 #

1、修改YunRspData

0.0.7 - 2020-03-13 #

1、修改YunRspData

0.0.6 - 2020-03-13 #

1、修复日志配置错误; 2、添加 model 转换模型,支持 factory;

0.0.5 - 2020-02-19 #

1、添加 http 的 delete 请求; 2、添加 http 的 原始请求; 3、添加 http 的返回数据解析模式;

0.0.4 - 2020-02-19 #

  • add YunPageNavigatorOn

0.0.3 - 2020-02-19 #

  • reform file name
  • add alert handle

0.0.2 - 2020-02-19 #

  • reform code

0.0.1 - 2020-02-18 #

  • init plugin

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.


    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  yun_base: ^0.0.14

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:yun_base/action/yun_action.dart';
import 'package:yun_base/alert/yun_alert.dart';
import 'package:yun_base/config/yun_config.dart';
import 'package:yun_base/http/yun_http.dart';
import 'package:yun_base/index.dart';
import 'package:yun_base/log/yun_log.dart';
import 'package:yun_base/model/yun_base_map_model.dart';
import 'package:yun_base/model/yun_base_model.dart';
import 'package:yun_base/model/yun_model_convert.dart';
import 'package:yun_base/model/yun_page_base_noti_model.dart';
import 'package:yun_base/model/yun_page_noti_interface.dart';
import 'package:yun_base/model/yun_rst_data.dart';
import 'package:yun_base/page/yun_base_page.dart';
import 'package:yun_base/toast/yun_toast.dart';
import 'package:yun_base/util/index.dart';
import 'package:yun_base/util/yun_date.dart';
import 'package:yun_base/util/yun_value.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
43
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:yun_base/action/yun_action.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:yun_base/action/yun_action.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:yun_base/action/yun_action.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:yun_base/action/yun_action.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • yun_base that is a package requiring null.

Health suggestions

Fix lib/model/yun_rst_data.dart. (-2.48 points)

Analysis of lib/model/yun_rst_data.dart reported 5 hints:

line 171 col 9: The left operand uses '?.', so its value can be null.

line 206 col 24: Equality operator == invocation with references of unrelated types.

line 208 col 21: Avoid using braces in interpolation when not needed.

line 208 col 32: Avoid using braces in interpolation when not needed.

line 208 col 51: Avoid using braces in interpolation when not needed.

Fix lib/page/yun_base_page.dart. (-0.50 points)

Analysis of lib/page/yun_base_page.dart reported 1 hint:

line 32 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: YunBasePage.model, YunBasePage.context1, YunBasePage.config

Format lib/alert/yun_alert.dart.

Run flutter format to format lib/alert/yun_alert.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/http/yun_http.dart (Run flutter format to format lib/http/yun_http.dart.)
  • lib/log/yun_log.dart (Run flutter format to format lib/log/yun_log.dart.)
  • lib/model/yun_model_convert.dart (Run flutter format to format lib/model/yun_model_convert.dart.)
  • lib/toast/yun_toast.dart (Run flutter format to format lib/toast/yun_toast.dart.)

Maintenance suggestions

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.3.0 <3.0.0
dio ^3.0.9 3.0.9
flutter 0.0.0
flutter_datetime_picker ^1.3.8 1.3.8
intl ^0.16.1 0.16.1
provider ^4.1.1 4.3.1
shared_preferences ^0.5.7+2 0.5.8
toast ^0.1.5 0.1.5
universal_platform ^0.1.3 0.1.3
Transitive dependencies
charcode 1.1.3
collection 1.14.12 1.14.13
file 5.2.1
flutter_web_plugins 0.0.0
http_parser 3.1.4
meta 1.1.8 1.2.2
nested 0.0.4
path 1.7.0
path_provider_linux 0.0.1+2
path_provider_platform_interface 1.0.2
platform 2.2.1
plugin_platform_interface 1.0.2
process 3.0.13
shared_preferences_linux 0.0.2+1
shared_preferences_macos 0.0.1+10
shared_preferences_platform_interface 1.0.4
shared_preferences_web 0.1.2+7
sky_engine 0.0.99
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
xdg_directories 0.1.0
Dev dependencies
flutter_test