flutter_text_justify_rtl 0.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

flutter_text_justify_rtl #

Temporary solution for Text widget not supporting TextAlign.JustifyRTL ( flutter issue #30986 )

https://github.com/flutter/flutter/issues/30986

IMPORTANT ! #

this is just a temporary solution and it is not an efficient code, if something better popped up or flutter team fixed the issue use that.

Getting Started #

dependencies:
  # others
  flutter_text_justify_rtl: ^0.0.1

[0.0.1] - TODO: Add release date. #

  • TODO: Describe initial release.

example/lib/main.dart

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

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

var para = """
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد. در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها و شرایط\n\n سخت تایپ به پایان رسد\n و زمان مورد نیاز شامل حروفچینی دستاوردهای اصلی و جوابگوی nturies , but also the leap into  سوالات پیوسته اهل  اساسا مورد استفاده قرار گیرد. 
"""
    .trim();

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Container(
          width: double.infinity,
          height: double.infinity,
          child: ListView(children: [
            LayoutBuilder(
              builder: (context, c) => TextJustifyRTL(
                para,
                textDirection: TextDirection.rtl,
                style: Theme.of(context).textTheme.subtitle,
                boxConstraints: c,
              ),
            ),
          ])),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_text_justify_rtl: ^0.0.3

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

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

  • Dart: 2.8.4
  • pana: 0.13.9+1
  • Flutter: 1.17.3

Analysis suggestions

Package not compatible with SDK dart

because of import path [flutter_text_justify_rtl]

Health suggestions

Format lib/flutter_text_justify_rtl.dart.

Run flutter format to format lib/flutter_text_justify_rtl.dart.

Maintenance suggestions

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.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test