Skip to content

Instantly share code, notes, and snippets.

@shubie
shubie / tailwindForms.js
Created September 22, 2024 04:06 — forked from srcrip/tailwindForms.js
This is just a copy-and-paste of the Tailwind Forms plugin that you can actually edit/customize/maintain + JSDoc types.
// Tailwind plugin for forms.
// Basically: https://github.com/tailwindlabs/tailwindcss-forms/blob/main/src/index.js
// But with a few changes. And it's easier to maintain this way.
const svgToDataUri = require("mini-svg-data-uri")
const plugin = require("tailwindcss/plugin")
const defaultTheme = require("tailwindcss/defaultTheme")
const colors = require("tailwindcss/colors")
const [baseFontSize, { lineHeight: baseLineHeight }] =
defaultTheme.fontSize.base
const { spacing, borderWidth, borderRadius } = defaultTheme
Widget listItemContainer(String title, String value) => Container(
margin: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
padding: EdgeInsets.symmetric(vertical: 10.0),
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(height: 5),
Text(
title,
showPowerBottomSheet(BuildContext context) => showModalBottomSheet(
isScrollControlled: true,
context: context,
builder: (context) {
return Container(
height: 600,
color: Color(0xFF737373),
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).canvasColor,
Padding(
padding: const EdgeInsets.fromLTRB(50, 5, 50, 5),
child: SizedBox(
width: double.infinity,
child: blueButton(
"Copy Token",
() {
Clipboard.setData(
new ClipboardData(text: "4671-0884-7276-4345-8709"));
Flushbar(
MaterialButton viewMoreButtons(String title, Function fun) {
return MaterialButton(
onPressed: fun,
textColor: Colors.white,
color: const Color(0xffFFAC38),
child: SizedBox(
width: double.infinity,
child: Text(
title,
textAlign: TextAlign.left,
RaisedButton blueButton(String label, Function fun) {
return RaisedButton(
onPressed: fun,
textColor: Colors.white,
color: Color(0xfff063057),
padding: const EdgeInsets.all(15.0),
child: Text(label),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
Center(
child: Stack(
children: <Widget>[
Align(
alignment: Alignment.center,
child: Container(
margin: const EdgeInsets.all(7.0),
padding: const EdgeInsets.all(30.0),
decoration: BoxDecoration(
border: Border.all(
SizedBox(height: 70),
Center(
child: Image.asset(
'assets/images/success-bulb/success-bulb.png',
width: size.width * .30,
fit: BoxFit.fill,
),
),
Center(
class SuccesfulPurchase extends StatelessWidget {
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return SafeArea(
child: Scaffold(
body: Column(
children: <Widget>[],
),
),
import 'package:flutter/material.dart';
import 'package:flushbar/flushbar.dart';
import 'package:flutter/services.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(