fule_text 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

FuleText #

Pub Version GitHub

一个可以自动适应父容器宽度的文本组件,主要用于解决不同机型文本超出容器的问题。

上方样例的 源码

开始 #

安装 #

该项目还在探索阶段,对外接口可能会存在较大变化,请选择好使用的版本。

在pubspec.yaml中添加依赖包

使用相对稳定的版本
fule_text: '>=0.1.1 <0.2.0'
或始终使用最新版本
fule_text: '^0.1.0'

获取依赖包

$ flutter pub get

引入 #

import 'package:fule_text/fule_text.dart';

参数 #

属性类型默认值必填说明组件版本
textString-内容0.1.0
styleTextStyle-样式0.1.0
textAlignTextAlignTextAlign.center对齐0.1.0
textDirectionTextDirectionTextDirection.ltr方向0.1.0

[0.1.1] 2020-05-04 #

  • 新增一个小例子

[0.1.0] 2020-05-04 #

  • FuleText第一个版本 🎉

example/main.dart

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

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

class MyApp extends StatefulWidget {
  MyApp({Key key}) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('FuleText'),
        ),
        body: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Text('正常的Text'),
            Text('The quick brown fox jumps over a lazy dog.'),
            SizedBox(
              height: 20,
            ),
            Text('在Container(width:250)中的Text:'),
            Container(
              width: 250,
              child: Text(
                'The quick brown fox jumps over a lazy dog.',
                maxLines: 1,
              ),
            ),
            SizedBox(
              height: 20,
            ),
            Text('在Container(width:250)中的FuleText:'),
            Container(
              width: 250,
              child: FuleText('The quick brown fox jumps over a lazy dog.'),
            ),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  fule_text: ^0.1.1

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:fule_text/fule_text.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [fule_text] that is in a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test