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

Any color is used to set the primarySwatch theme color.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:set_primary_swatch_color/set_primary_swatch_color.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 Color _colorTheme = const Color.fromARGB(255, 191, 231, 163);
  SetMaterialColor setColor = SetMaterialColor();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
          primarySwatch: setColor.createMaterialColor(_colorTheme)
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
            child: ElevatedButton(child: Text('$_colorTheme'), onPressed: (){},)
        ),
      ),
    );
  }
}
1
likes
140
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

Any color is used to set the primarySwatch theme color.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on set_primary_swatch_color

Packages that implement set_primary_swatch_color