Milad-Akarie / skeletonizer

MIT License
367 stars 24 forks source link

Extended SkeletonizerConfigData to utilize ThemeExtension for simplif… #39

Closed v0fbu1vm closed 4 months ago

v0fbu1vm commented 5 months ago

Description

Change: Extend SkeletonizerConfigData with ThemeExtension for improved theme configuration.

Details:

Example Import:


import 'package:atlassync/config/themes/app_colors.dart';
import 'package:flutter/material.dart';
import 'package:skeletonizer/skeletonizer.dart';

final lightSkeletonizerTheme = skeletonizerConfigData.copyWith(
    containersColor: lightColors.primary,
    effect: const SoldColorEffect(color: Colors.green));

final darkSkeletonizerTheme = skeletonizerConfigData.copyWith(
    containersColor: darkColors.primary,
    effect: const SoldColorEffect(color: Colors.green));

final dimSkeletonizerTheme = skeletonizerConfigData.copyWith(
    containersColor: dimColors.primary,
    effect: const SoldColorEffect(color: Colors.green));

/// Theme data for the light theme mode.
final lightThemeData = ThemeData(
  useMaterial3: true,
  extensions: [
    lightSkeletonizerTheme
  ],
);

/// Theme data for the dark theme mode.
final darkThemeData = ThemeData(
  useMaterial3: true,
  extensions: [darkSkeletonizerTheme],
);

/// Theme data for the dim theme mode.
final dimThemeData = ThemeData(
  useMaterial3: true,
  extensions: [dimSkeletonizerTheme],
);
Milad-Akarie commented 4 months ago

@waadsulaiman Thanks for your efforts, This looks much better, might remove the theme instance thu