theme_pkg 0.0.1 copy "theme_pkg: ^0.0.1" to clipboard
theme_pkg: ^0.0.1 copied to clipboard

A new Flutter widget for buttons.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:theme_pkg/buttons/button.dart';
import 'package:theme_pkg/buttons/button_util.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text("Buttons demo"),
        ),
        body: Padding(
          padding: const EdgeInsets.all(20.0),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Buttons.outline(
                text: "Outline Button",
                onPressed: () {
                  print("Outline Button Clicked");
                },
                size: ButtonSize.md,
                backgroundColor: Colors.blue,
                textColor: Colors.white,
              ),
              const SizedBox(height: 20),
              Buttons.primary(
                text: "Primary Button",
                onPressed: () {
                  print("Primary Button Clicked");
                },
                size: ButtonSize.md,
                backgroundColor: Colors.blue,
                textColor: Colors.white,
              ),
              const SizedBox(height: 20),
              Buttons.text(
                text: "Text Button",
                onPressed: () {
                  print("Text Button Clicked");
                },
                textColor: Colors.black,
              ),
            ],
          ),
        ));
  }
}
1
likes
120
points
9
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A new Flutter widget for buttons.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, google_fonts

More

Packages that depend on theme_pkg