flutex 1.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 62

Flutter widget extensions for functional creating UI. #

pub package

Getting Started #

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

dependencies:
  flutex: ^1.1.0

Then add import to your dart file (right now VSCode and Android studio cannot auto import files for dart extensions):

import 'package:flutex/flutex.dart';

Available extensions #

Extension functionPurpose
.padding()Wrap widget with Padding
.expanded()Wrap widget with Expanded
.flexible()Wrap widget with Flexible
.opacity()Wrap widget with Opacity
.align()Wrap widget with Align
.center()Wrap widget with Center
.top()Wrap widget with Align(alignment: Alignment.topCenter)
.bottom()Wrap widget with Align(alignment: Alignment.bottomCenter)
.left()Wrap widget with Align(alignment: Alignment.centerLeft)
.right()Wrap widget with Align(alignment: Alignment.centerRight)
.positioned()Wrap widget with Positioned
.rotatedBox()Wrap widget with RotatedBox
.sizedBox()Wrap widget with SizedBox
.constrainedBox()Wrap widget with ConstrainedBox
.expand()Wrap widget with ConstrainedBox(constraints: BoxConstraints.expand())
.visibility()Wrap widget with Visibility
.safeArea()Wrap widget with SafeArea
.onTap()Wrap widget with GestureDetector
.inkWell()Wrap widget with InkWell
.materialInkWell()Wrap widget with Material includes InkWell
.rotate()Wrap widget with Transform.rotate
.scale()Wrap widget with Transform.scale
.translate()Wrap widget with Transform.translate
.sliverListChild()Wrap widget with SliverList includes SliverChildListDelegate

Example #

Check lib/example/lib/main.dart

License #

MIT licensed

Changelog #

1.1.1 #

  • Add sliverListChild extension

1.1.0 #

  • Remove all non-widget extensions, add some new extensions.

1.0.1+2 #

  • Small fixes with Visibility, add SafeArea

1.0.1 #

  • Small fixes (with partially broken backward compatibility), add some extensions

1.0.0 #

  • First Release

example/lib/main.dart

import 'dart:math';

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

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

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> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Text(
            'You have pushed the button this many times:',
          ).center().padding(padding: EdgeInsets.all(20.0)),
          Text(
            '$_counter',
            style: Theme.of(context).textTheme.headline1,
          ).inkWell(() {}).right().rotate(angle: pi / 4),
        ],
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutex: ^1.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:flutex/flutex.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
27
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
93
Overall:
Weighted score of the above. [more]
62
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 not compatible with SDK dart

Because:

  • flutex that is a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

27 out of 27 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance suggestions

The package description is too short. (-7 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.

Dependencies

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