simple_code 2.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

Simple Code #

Make Responsive and Development Faster and Easier

Functions #

Responsive and izi :)

new Container(
	height: hsz(250),
	width: wsz(250),
)
new Text("My Text",style:new TextStyle(fontSize: sz(15))); 

Expanded Icon and Text

expandedText(new Text("My Text")); 
expandedIcon(new Icon(Icons.wifi));

Animated navigator with very simples

navigator(context, duration: Duration(milliseconds: 800),page: new Page(),navFrom: NavFrom.rigth,curves: Curves.elasticOut); 

To use: #

Import the package #

To use this plugin, follow the plugin installation instructions.

Use the plugin #

Add the following import to your Dart code:

import 'package:simple_code/simple_code.dart';

Getting Started #

Just set SimpleCode context inside Widget build() on every screen

setSc(context);

You can change the standard screen size:

setSc(context,heigthEmulator: 640,widthEmulator: 360);

heigthEmulator is a size of prototipe heigth and widthEmulator is a size of prototipe width

640 (height) and 360 (width) are the default Android screen size in Adobe XD.
Change this to the screen size used in the prototype.

Text #

expandedText(new Text("My Text")); 

new Text("My Text",style:new TextStyle(fontSize: sz(15))); 

You can change max and min font Size

navigator(context, duration: Duration(milliseconds: 800),page: new Page(),navFrom: NavFrom.rigth,curves: Curves.elasticOut);

You can choose one or two NavFrom, to match animations

navFrom: NavFrom.rigth, secondNavFrom: NavFrom.fade 
is other than
navFrom: NavFrom.fade, secondNavFrom: NavFrom.rigth

Animations:

fade, left, rigth, bottom, top, scale, rotation,

Curves:

 All types of Curves
 Ex: Curves.easeIn

Types:

 pop, push, pushReplacement

Icons #

new Expanded(child: expandedIcon(new Icon(Icons.wifi))); 

or

expandedIcon(new Icon(Icons.wifi));

or

new Icon(Icons.youtube_searched_for, size: sz(50));

to responsive icon without expanded

Yes, it's that easy. #

2.0.1 #

setSc(context); just once

2.0.0 #

  • Colors removed
  • sC.size(50) to sz(50)
  • SimpleCode sc = new SimpleCode(context); to setSc(context);
  • sz(50) to hsz(50), wsz(50) or sz(50)
  • sC.navigator() to > navigator()
  • sC.expandedText() to expandedText()
  • sC.expandedIcon() to expandedIcon()

1.1.2 #

  • Fix Curves
  • Added route generator

1.1.1 #

  • Android X

1.1.0 #

  • Readme Fix

1.0.11 #

  • Fix bug color expandedText
  • sC.widget(size:50) to sC.size(50)

1.0.0 #

  • Initial release.

example/README.md

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

void main() => runApp(new Home());

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: new Page1(),
    );
  }
}

class Page1 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
	setSc(context);
    return new Scaffold(
        body: Center(
      child: new Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          mynavigator(),
          responsiveContainerWithExpandedIcon(),
          responsiveIcon(),
          myexpandedIcon(),
          responsiveContainerWithExpandedText(),
          myexpandedText(),
        ],
      ),
    ));
  }

  InkWell mynavigator() {
    return InkWell(
      child: Container(
        height: hsz(50.0),
        width: wsz(50.0),
        alignment: Alignment.center,
        color: Colors.red,
        child: expandedText(new Text(
            "Util Navigator\nNavType.push\nNavFrom.rigth\nSecondNavFrom.fade")),
      ),
      onTap: () {
        navigator(
          duration: Duration(milliseconds: 800),
          page: new Page2(),
          navFrom: NavFrom.rigth,
          secondNavFrom: NavFrom.fade,
          navType: NavType.push,
          curves: Curves.elasticOut,
        );
      },
    );
  }

  Expanded myexpandedText() =>
      Expanded(child: expandedText(new Text("Expanded Text")));

  Container responsiveContainerWithExpandedText() {
    return Container(
      height: hsz(50.0),
      width: wsz(50.0),
      color: Colors.red,
      alignment: Alignment.center,
      child: expandedText(new Text(
        "Text Container",
        maxLines: 2,
        textAlign: TextAlign.center,
      )),
    );
  }

  myexpandedIcon() =>
      new Expanded(child: expandedIcon(new Icon(Icons.wifi)));

  Icon responsiveIcon() =>
      new Icon(Icons.youtube_searched_for, size: sz(50.0));

  Container responsiveContainerWithExpandedIcon() {
    return new Container(
      color: Colors.yellow,
      height: hsz(50.0),
      width: wsz(50.0),
      child: expandedIcon(new Icon(Icons.hd, color: Colors.red)),
    );
  }
}

class Page2 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    setSc(context);
    return Scaffold(
      backgroundColor: Colors.red,
      body: new Center(
        child: new FlatButton(
          child: new Text("pop"),
          onPressed: () {
            navigator(navType: NavType.pop);
          },
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


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

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

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/navigator.dart.

Run flutter format to format lib/navigator.dart.

Maintenance suggestions

The package description is too short. (-11 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.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test