Skip to content

Instantly share code, notes, and snippets.

@JoseAlba
Last active July 30, 2023 16:41
Show Gist options
  • Save JoseAlba/a205e21aa0d0a64fe7c977107ce22cbf to your computer and use it in GitHub Desktop.
Save JoseAlba/a205e21aa0d0a64fe7c977107ce22cbf to your computer and use it in GitHub Desktop.
Dartpad, Gist, and iFrames
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Flutter Applcation Embedded in Website'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'The Gist URL to this website is:',
textAlign: TextAlign.center,
),
Text(
'https://gist.github.com/JoseAlba/a205e21aa0d0a64fe7c977107ce22cbf \n',
textAlign: TextAlign.center,
),
Text(
'The Dartpad URL to this website is:',
textAlign: TextAlign.center,
),
Text(
'https://dartpad.dev/a205e21aa0d0a64fe7c977107ce22cbf \n',
textAlign: TextAlign.center,
),
Text(
'The iFrame code is:',
textAlign: TextAlign.center,
),
Text(
'<iframe src="https://dartpad.dev/embed-flutter.html?id=a205e21aa0d0a64fe7c977107ce22cbf"></iframe> \n',
textAlign: TextAlign.center,
),
Text(
'This Flutter application might be within an iFrame within a Medium post. \n',
textAlign: TextAlign.center,
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment