simple_code 3.3.0 simple_code: ^3.3.0 copied to clipboard
Make Responsive, Development and InAppPurchases Faster and Easier
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();
Navigator without context #
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