pinterest_embed_plugin 2.0.0
pinterest_embed_plugin: ^2.0.0 copied to clipboard
A Flutter plugin for embedding Pinterest boards and profiles on the web. Seamlessly integrate a Pinterest-like user experience into your web application.
import 'package:flutter/material.dart';
import 'package:pinterest_embed_plugin/pinterest_embed_plugin.dart';
import 'package:pinterest_embed_plugin_example/device_resolutions.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final _boardWidth = 1440;
final _scaleWidth = 200;
final _scaleHeight = 600;
final _boardWidthMobile = 400;
final _scaleWidthMobile = 80;
final _scaleHeightMobile = 1080;
final _boardWidthTablet = 900;
final _scaleWidthTablet = 80;
final _scaleHeightTablet = 600;
@override
void initState() {
super.initState();
}
Widget _displayMobile() {
return PinterestEmbedPlugin(
boardUrl:
'https://za.pinterest.com/botiqmagazine/b-o-t-i-q-n-a-i-l-i-n-s-p-o/',
boardWidth: _boardWidthMobile,
scaleHeight: _scaleHeightMobile,
scaleWidth: _scaleWidthMobile,
);
}
Widget _displayTablet() {
return PinterestEmbedPlugin(
boardUrl:
'https://za.pinterest.com/botiqmagazine/b-o-t-i-q-n-a-i-l-i-n-s-p-o/',
boardWidth: _boardWidthTablet,
scaleHeight: _scaleHeightTablet,
scaleWidth: _scaleWidthTablet,
);
}
Widget _displayDesktop() {
return PinterestEmbedPlugin(
boardUrl:
'https://za.pinterest.com/botiqmagazine/b-o-t-i-q-n-a-i-l-i-n-s-p-o/',
boardWidth: _boardWidth,
scaleHeight: _scaleHeight,
scaleWidth: _scaleWidth,
);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Plugin example app')),
body: SingleChildScrollView(
child: Column(
children: [
SizedBox(
height: 1080,
child: Center(
child:
AppDeviceResolution.isMobile(context)
? _displayMobile()
: AppDeviceResolution.isTablet(context)
? _displayTablet()
: _displayDesktop(),
),
),
const SizedBox(height: 12),
SizedBox(
height: 1080,
child: Center(
child:
AppDeviceResolution.isMobile(context)
? _displayMobile()
: AppDeviceResolution.isTablet(context)
? _displayTablet()
: _displayDesktop(),
),
),
],
),
),
),
);
}
}