Skip to content

Instantly share code, notes, and snippets.

View rcdevgames's full-sized avatar
🏠
Working from home

Rizky Andhika rcdevgames

🏠
Working from home
View GitHub Profile
@rcdevgames
rcdevgames / blocs_provider.dart
Created February 7, 2019 13:18 — forked from putraxor/blocs_provider.dart
Multiple Blocs Provider for Flutter
import 'package:flutter/material.dart';
import 'package:model/blocs/base_bloc.dart';
/// Used to give [child] and all it's subsequent children access to [blocs].
/// To get a reference to 'SomeBloc' from a child use: BlocsProvider.of<SomeBloc>(context)
class BlocsProvider extends StatefulWidget {
BlocsProvider({Key key, @required this.child, @required this.blocs})
: super(key: key);
final Widget child;
@rcdevgames
rcdevgames / autoscroll_text.dart
Created February 16, 2019 15:30 — forked from putraxor/autoscroll_text.dart
Flutter Marquee Text Widget
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
class AutoScrollText extends StatefulWidget {
final double height;
final List<Widget> items;
AutoScrollText({this.height = 24.0, this.items});
@override
State<StatefulWidget> createState() => new _AutoScrollTextState();
@rcdevgames
rcdevgames / custom_error_widget.dart
Created February 16, 2019 15:30 — forked from putraxor/custom_error_widget.dart
Show user-friendly error page instead of exception in Flutter
Widget getErrorWidget(BuildContext context, FlutterErrorDetails error) {
return Center(
child: Text(
"Error appeared.",
style: Theme.of(context).textTheme.title.copyWith(color: Colors.white),
),
);
}
class MyApp extends StatelessWidget {
@rcdevgames
rcdevgames / fade_route.dart
Created February 16, 2019 15:31 — forked from putraxor/fade_route.dart
A route which fades the page in.
import 'package:flutter/material.dart';
/// Navigator.of(context).push(FadeRoute(
/// builder: (context) {
/// return NewPage();
/// }
/// ));
class FadeRoute extends PageRoute {
FadeRoute({@required this.builder});
@rcdevgames
rcdevgames / rich_text_view.dart
Created February 16, 2019 15:31 — forked from putraxor/rich_text_view.dart
Flutter rich text view with clickable hyperlink
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart' as launcher;
///TODO: check performance impact bro !!!
class LinkTextSpan extends TextSpan {
LinkTextSpan({TextStyle style, String url, String text})
: super(
style: style,
@rcdevgames
rcdevgames / infinite_scroll.dart
Created February 16, 2019 15:31 — forked from putraxor/infinite_scroll.dart
Flutter infinite scrolling
import 'dart:async';
import 'package:flutter/material.dart';
class InfiniteScroll extends StatefulWidget {
@override
_InfiniteScrollState createState() => new _InfiniteScrollState();
}
class _InfiniteScrollState extends State<InfiniteScroll> {
Sublime text 3 (Build 3100 to 3114) - license key [ tested on Mac OS ]
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
@rcdevgames
rcdevgames / upload.js
Created April 14, 2020 17:20 — forked from iamaddy/upload.js
ajax upload base64 image
function dataURItoBlob(dataURI) {
var byteString = atob(dataURI.split(',')[1]);
var ab = new ArrayBuffer(byteString.length);
var ia = new Uint8Array(ab);
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
return new Blob([ab], { type: 'image/jpeg' });
}
function supportFile (){
RF PH - Praxis Bell Rider lvl 40 - Official
RF Brazen - Cora Pure Wizards lvl 55 or 60
RF Olympic - Bell
RF USA Official - ACC Punisher lvl 50, Spec lvl 45
RF Nexus - ACC Punisher/Warder - Spec PB Hunter
Welcome Gift - Get Jade of Punishment/ 2
@rcdevgames
rcdevgames / Linux Static IP
Created September 24, 2020 17:01 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static