Skip to content

Instantly share code, notes, and snippets.

View sagarshende23's full-sized avatar
😇
Helping Others

Sagar Shende sagarshende23

😇
Helping Others
View GitHub Profile
import 'package:flutter/material.dart';
class AddToCart extends StatelessWidget {
final ProductModel product;
AddToCart({Key key, @required this.product}) : super(key: key);
void showConfirm(context, cart) {
showDialog(
context: context,
import 'package:flutter/material.dart';
import 'package:flutter_offline/flutter_offline.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
void _onTapDown(TapDownDetails details) {
_controller.forward();
}
void _onTapUp(TapUpDetails details) {
_controller.reverse();
}
@override
Widget build(BuildContext context) {
_scale = 1 - _controller.value;
return GestureDetector(
onTapDown: _onTapDown,
onTapUp: _onTapUp,
child: Transform.scale(
scale: _scale,
child: _animatedButtonUI,
),
Widget get _animatedButtonUI => Container(
height: 70,
width: 200,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100.0),
boxShadow: [
BoxShadow(
color: Color(0x80000000),
blurRadius: 30.0,
offset: Offset(0.0, 5.0),
import 'package:flutter/material.dart';
import 'package:firebase_admob/firebase_admob.dart';
const String testDevice = 'MobileId';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
@override
void initState() {
FirebaseAdMob.instance.initialize(appId: BannerAd.testAdUnitId);
//Change appId With Admob Id
_bannerAd = createBannerAd()
..load()
..show();
super.initState();
}
static const MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
testDevices: testDevice != null ? <String>[testDevice] : null,
nonPersonalizedAds: true,
keywords: <String>['Game', 'Mario'],
);
BannerAd _bannerAd;
InterstitialAd _interstitialAd;
//Banner Ads
BannerAd createBannerAd() {
import 'package:flutter/material.dart';
import 'package:giffy_dialog/giffy_dialog.dart';
void main() => runApp(MyApp());
const List<Key> keys = [
Key('Network'),
Key('Network Dialog'),
Key('Flare'),
Key('Flare Dialog'),
//Asset Giffy Dialog
RaisedButton(
key: keys[4],
child: Text('Asset Giffy'),
onPressed: () {
showDialog(
context: context,
builder: (_) => AssetGiffyDialog(
key: keys[5],
image: Image.asset('assets/rappi_basket.gif'),