simple_code 3.3.0

Functions #

Simplified Navigator #

Simplified Billing (In App Purchases) #

Simplified Rate My App #

Simplified Responsivity #

ExpandedText #

ExpandedIcon #

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

Expanded Icon and Text

ExpandedText("My Text"); 
ExpandedIcon(Icons.wifi);

Animated navigator with very simples

SimpleNavigator.push(customPageRoute(
    Page(),
    curve: Curves.easeOutBack,
    duration: Duration(milliseconds: 600),
    transitions: [
        Transition.slide_from_top,
        Transition.slide_from_rigth,
        Transition.fade_in,
    ],
));

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 #

return MaterialApp(
    navigatorKey: SimpleNavigator.key,
    home: new MyApp(),
);

You can change the standard screen size:

SimpleCode.changeEmulatorSize(heigth: 640, width: 360);

heigth is a size of prototipe heigth and width 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("My Text"); 

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

You can change max and min font Size

Simple Billing #

await SimpleBilling.init(
  onPurchaseUpdated: (String productId, bool isNewPurchase) {},
  productsId: allProductsIds,
  popUpWidget: SimpleBilling.defaultPopUpWidget,
  offline: true,
);
SimpleBilling.buyProduct(productId, context: context);
SimpleBilling.checkPurchase(productId);
SimpleBilling.checkPurchases([productOneId, productTwoId]);
SimpleBilling.getPriceById(productId);
SimpleBilling.restorePurchases();
SimpleBilling.setFakePurchases({productId});

Simple RateMyApp #

await SimpleRateMyApp.init({
    int minDays = 7,
    int minLaunches = 10,
    int remindDays = 7,
    int remindLaunches = 10,
    void Function() onShowIOS = openIosRateDialog,
    void Function() onShowAndroid,
    bool Function() ruleToShow,
  });
SimpleRateMyApp.show();
SimpleRateMyApp.openIosRateDialog();
SimpleRateMyApp.openStore();
SimpleRateMyApp.dontShowMore();
SimpleRateMyApp.reset();
SimpleNavigator.push(cupertinoPageRoute(Page()));

You can choose a list of Transitions, to match animations

SimpleNavigator.push(customPageRoute(
    Page(),
    curve: Curves.easeOutBack,
    duration: Duration(milliseconds: 600),
    transitions: [
        Transition.slide_from_top,
        Transition.slide_from_rigth,
        Transition.fade_in,
    ],
));

Transitions:

fade_in, slide_from_bottom, slide_from_rigth, slide_from_left, slide_from_top, zoom_in,

Curves:

 All types of Curves
 Ex: Curves.easeIn

Types:

 pop, push, pushReplacement, etc... 

Icons #

new Expanded(child: ExpandedIcon(Icons.wifi)); 

or

ExpandedIcon(Icons.wifi);

or

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

to responsive icon without expanded

Yes, it's that easy. #

3.3.0 #

  • Feat SimpleProvider
  • Feat MultiStreamBuilder Widget

3.2.8+1/3.2.8+2 #

  • Update README

3.2.8 #

  • Fix SimpleBilling ClosePopUp

3.2.7 #

  • Fix SimpleBilling Consume Item Android

3.2.6 #

  • Feat customPageBuilder

3.2.5 #

  • Update README

3.2.4 #

  • Fix return type SimpleNavigator.pop()

3.2.3 #

  • Fix SimpleBilling getPrice to return null

3.2.2 #

  • Fix SimpleBilling contains null

3.2.1 #

  • Fix SimpleBilling getPrice
  • Feat SimpleBilling getProductById

3.2.0 #

  • New Feature SimpleRateMyApp

3.1.2 #

  • Fix SimpleBilling Offline Purchases

3.1.1 #

  • SimpleBilling.products

3.1.0 #

  • New Feature SimpleBilling

3.0.0 #

  • New Feature SimpleNavigator

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(
      navigatorKey: SimpleCode.navigatorKey,
      home: new Page1(),
    );
  }
}

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

  InkWell mynavigator(context) {
    return InkWell(
      child: Container(
        height: hsz(50.0),
        width: wsz(50.0),
        alignment: Alignment.center,
        color: Colors.red,
        child: ExpandedText(
            "Util Navigator\nNavType.push\nNavFrom.rigth\nSecondNavFrom.fade"),
      ),
      onTap: () {
        pushWithoutContext();
      },
    );
  }

  pushWithoutContext() {
    SimpleNavigator.push(customPageRoute(
      Page2(),
      curve: Curves.easeOutBack,
      duration: Duration(milliseconds: 600),
      transitions: [
        Transition.slide_from_top,
        Transition.slide_from_rigth,
        Transition.fade_in,
      ],
    ));
    //SimpleNavigator.push(cupertinoPageRoute(Page2()));
    //SimpleNavigator.push(materialPageRoute(Page2()));
  }

  Expanded myexpandedText() => Expanded(child: ExpandedText("Expanded Text"));

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

  myexpandedIcon() => new Expanded(child: ExpandedIcon(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(Icons.hd, color: Colors.red),
    );
  }
}

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

  popWithOutContext() {
    SimpleNavigator.pop();
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  simple_code: ^3.3.0

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]
72
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]
86
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
app_review ^1.1.0+1 1.1.0+1
flutter 0.0.0
flutter_inapp_purchase ^2.1.1 2.1.2
shared_preferences ^0.5.6+1 0.5.6+2
Transitive dependencies
async 2.4.0
charcode 1.1.3
collection 1.14.11 1.14.12
flutter_web_plugins 0.0.0
http 0.12.0+4
http_parser 3.1.3
meta 1.1.8
package_info 0.4.0+14
path 1.6.4
pedantic 1.9.0
platform 2.2.1
plugin_platform_interface 1.0.2
shared_preferences_macos 0.0.1+6
shared_preferences_platform_interface 1.0.3
shared_preferences_web 0.1.2+4
sky_engine 0.0.99
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
url_launcher 5.4.2
url_launcher_macos 0.0.1+4
url_launcher_platform_interface 1.0.6
url_launcher_web 0.1.1+1
vector_math 2.0.8
Dev dependencies
flutter_test
lint ^1.1.1