{"id":24731436,"url":"https://github.com/vchib1/lightdarkthemetoggle","last_synced_at":"2026-02-26T00:43:10.658Z","repository":{"id":272792387,"uuid":"917797953","full_name":"vchib1/LightDarkThemeToggle","owner":"vchib1","description":"The LightDarkThemeToggle widget is a customizable and animated light/dark theme toggle switch for Flutter apps. It provides a visually appealing way for users to switch between light and dark modes in your app.","archived":false,"fork":false,"pushed_at":"2025-02-12T09:37:10.000Z","size":4614,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T11:51:41.671Z","etag":null,"topics":["animation","dart","flutter","flutter-package","flutter-widget","pub-dev","theme-switch","theme-toggle"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/light_dark_theme_toggle","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vchib1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-16T17:02:42.000Z","updated_at":"2025-02-12T09:37:13.000Z","dependencies_parsed_at":"2025-01-16T17:38:03.897Z","dependency_job_id":"b84d3c5d-e781-40c8-913a-5b547e951f1b","html_url":"https://github.com/vchib1/LightDarkThemeToggle","commit_stats":null,"previous_names":["vchib1/lightdarkthemetoggle"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vchib1/LightDarkThemeToggle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchib1%2FLightDarkThemeToggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchib1%2FLightDarkThemeToggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchib1%2FLightDarkThemeToggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchib1%2FLightDarkThemeToggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vchib1","download_url":"https://codeload.github.com/vchib1/LightDarkThemeToggle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vchib1%2FLightDarkThemeToggle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260183299,"owners_count":22971200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","dart","flutter","flutter-package","flutter-widget","pub-dev","theme-switch","theme-toggle"],"created_at":"2025-01-27T16:49:28.180Z","updated_at":"2026-02-26T00:43:10.620Z","avatar_url":"https://github.com/vchib1.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LightDarkThemeToggle\n\nThe `LightDarkThemeToggle` widget is a customizable and animated light/dark theme toggle switch for\nFlutter apps. It provides a visually appealing way for users to switch between light and dark modes\nin your app.\n\n## Features\n\n- Customizable size, color, padding, and tooltip.\n- Smooth animations with adjustable duration and curves.\n- Multiple animated icon styles using different theme icon types.\n- Built entirely with Dart code and `CustomPainter` for efficient rendering and better performance.\n\n## Demo\n\n[LightDarkThemeToggle Web App](https://vchib1.github.io/LightDarkThemeToggleWebApp/)\n\n## Preview\n\n![LightDarkThemeToggle Demo](https://raw.githubusercontent.com/vchib1/LightDarkThemeToggleWebApp/refs/heads/master/assets/demo.gif)\n\n---\n\n## Installation\n\n1. Add the dependency to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  light_dark_theme_toggle: ^1.1.2\n```\n\n2. Import the package in your Dart file:\n\n```dart\nimport 'package:light_dark_theme_toggle/light_dark_theme_toggle.dart';\n```\n\n---\n\n## Usage\n\nHere is an example of how to use the `LightDarkThemeToggle` widget:\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:light_dark_theme_toggle/light_dark_theme_toggle.dart';\n\nvoid main() =\u003e runApp(MyApp());\n\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      theme: ThemeData.light(),\n      darkTheme: ThemeData.dark(),\n      themeMode: ThemeMode.system,\n      home: Scaffold(\n        appBar: AppBar(title: Text('Light/Dark Theme Toggle')),\n        body: Center(\n          child: LightDarkThemeToggle(\n            value: false,\n            // Initial value (false for dark, true for light)\n            onChanged: (bool value) {\n              // Handle theme change here.\n            },\n            size: 48.0,\n            themeIconType: ThemeIconType.expand,\n            color: Colors.orange,\n            tooltip: 'Toggle Theme',\n            duration: Duration(milliseconds: 500),\n            curve: Curves.easeInOut,\n          ),\n        ),\n      ),\n    );\n  }\n}\n```\n\n---\n\n## Properties\n\n| Property          | Type                  | Default                           | Description                                                            |\n|-------------------|-----------------------|-----------------------------------|------------------------------------------------------------------------|\n| `value`           | `bool`                | Required                          | Determines whether the toggle is in light (true) or dark (false) mode. |\n| `onChanged`       | `ValueChanged\u003cbool\u003e`  | Required                          | Callback when the toggle is pressed.                                   |\n| `themeIconType`   | `ThemeIconType`       | `ThemeIconType.expand`            | Defines the style of the icon.                                         |\n| `color`           | `Color?`              | `ThemeData.colorScheme.onSurface` | Color of the icon.                                                     |\n| `hoverColor`      | `Color?`              | `ThemeData.hoverColor`            | Hover Color of the toggle.                                             |\n| `highlightColor`  | `Color?`              | `ThemeData.highlightColor`        | Highlight Color of the toggle in pressed down state.                   |\n| `focusColor`      | `Color?`              | `ThemeData.focusColor`            | Focus Color of the toggle when it has input focus.                     |\n| `splashColor`     | `Color?`              | `ThemeData.splashColor`           | Splash Color of the toggle.                                            |\n| `tooltip`         | `String?`             | `null`                            | Tooltip displayed on long press or hover.                              |\n| `padding`         | `EdgeInsetsGeometry?` | `null`                            | Padding around the icon.                                               |\n| `size`            | `double?`             | `IconTheme.size ?? 24.0`          | Size of the icon.                                                      |\n| `duration`        | `Duration`            | `Duration(milliseconds: 500)`     | Duration of the animation.                                             |\n| `reverseDuration` | `Duration`            | `Duration(milliseconds: 500)`     | Duration of the reverse animation.                                     |\n| `curve`           | `Curve`               | `Curves.easeOutBack`              | Animation curve for the forward animation.                             |\n| `reverseCurve`    | `Curve`               | `Curves.easeOutBack`              | Animation curve for the reverse animation.                             |\n\n---\n\n## Theme Icon Types\n\nThe widget supports the following icon types via the `ThemeIconType` enum:\n\n- **Classic**\n- **Simple**\n- **Eclipse**\n- **HalfSun**\n- **DarkSide**\n- **InnerMoon**\n- **Expand**\n- **DarkInner**\n\nTo use an icon type, pass it to the `themeIconType` property. For example:\n\n```dart\nLightDarkThemeToggle(\n  themeIconType:ThemeIconType.eclipse,\n  ...\n)\n```\n\n---\n\n## Customization\n\n### Animation\n\nYou can adjust the animation by changing:\n\n- `duration`: Duration of the forward animation.\n- `reverseDuration`: Duration of the reverse animation.\n- `curve`: Curve for forward animation.\n- `reverseCurve`: Curve for reverse animation.\n\n### Appearance\n\nYou can customize the icon's:\n\n- `size`: Adjust the size of the toggle.\n- `padding`: Add padding around the icon.\n- `tooltip`: Set a tooltip message for accessibility.\n- `color`: Change the icon's color.\n- `hoverColor`: Change the toggle's color in hovering state.\n- `focusColor`: Change the toggle's color when it has the input focus.\n- `highlightColor`: Change the toggle's color in pressed down state.\n- `splashColor`: Change the toggle's splash color.\n\n---\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n## Contributions\n\nContributions, issues, and feature requests are welcome! Feel free to check out\nthe [issues page](https://github.com/vchib1/LightDarkThemeToggle/issues).\n\n---\n\n## Author\n\n[Vivek Chib](https://github.com/vchib1)\n\n---\n\n## Acknowledgments\n\nThis package is inspired by [toggles.dev](https://toggles.dev/) created\nby [Alfie Jones](https://github.com/AlfieJones).  \nSpecial thanks for providing inspiration and ideas that helped shape this package.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvchib1%2Flightdarkthemetoggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvchib1%2Flightdarkthemetoggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvchib1%2Flightdarkthemetoggle/lists"}