quick_settings_tile 0.0.1
quick_settings_tile: ^0.0.1 copied to clipboard
A powerful and easy-to-use Flutter package for creating custom Quick Settings Tiles on Android devices. Add interactive tiles to your app that users can access directly from their device's quick setti [...]
Quick Settings Tile #
A powerful and easy-to-use Flutter package for creating custom Quick Settings Tiles on Android devices. Add interactive tiles to your app that users can access directly from their device's quick settings panel.

β¨ Features #
- π― Create custom Quick Settings Tiles for Android
- π Update tile state dynamically
- π¨ Customize tile icon, label, and subtitle
- π± Support for active/inactive states
- π Simple and intuitive API
- β‘ Lightweight with minimal dependencies
π Requirements #
- Flutter SDK: >=2.12.0
- Android: API level 24 (Android 7.0) or higher
- Kotlin version: 1.7.0 or higher
π¦ Installation #
Add this to your package's pubspec.yaml file:
dependencies:
quick_settings_tile: ^1.0.0
Then run:
flutter pub get
π§ Android Setup #
1. Update AndroidManifest.xml #
Add the following permission and service declaration inside the <application> tag:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<!-- Your existing code -->
<service
android:name=".QuickSettingsTileService"
android:exported="true"
android:icon="@drawable/ic_tile"
android:label="@string/tile_label"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
</application>
</manifest>
2. Update build.gradle #
Ensure your android/app/build.gradle has minimum SDK version 24:
android {
defaultConfig {
minSdkVersion 24
// other configurations
}
}
π Usage #
Basic Example #
import 'package:quick_settings_tile/quick_settings_tile.dart';
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final QuickSettingsTile _qsTile = QuickSettingsTile();
bool _isActive = false;
@override
void initState() {
super.initState();
_initializeTile();
}
Future<void> _initializeTile() async {
await _qsTile.initialize();
// Listen to tile clicks
_qsTile.onTileClicked(() {
setState(() {
_isActive = !_isActive;
});
_updateTile();
});
}
Future<void> _updateTile() async {
await _qsTile.updateTile(
label: _isActive ? 'Active' : 'Inactive',
state: _isActive ? TileState.active : TileState.inactive,
subtitle: _isActive ? 'Tap to deactivate' : 'Tap to activate',
);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Quick Settings Tile Demo')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Tile Status: ${_isActive ? "Active" : "Inactive"}'),
SizedBox(height: 20),
ElevatedButton(
onPressed: () {
setState(() {
_isActive = !_isActive;
});
_updateTile();
},
child: Text('Toggle Tile'),
),
],
),
),
),
);
}
}
π API Reference #
QuickSettingsTile Class #
Methods
initialize()- Initialize the Quick Settings TileupdateTile({String? label, TileState? state, String? subtitle})- Update tile appearance and stateonTileClicked(Function callback)- Register a callback for tile click eventsgetTileState()- Get current tile statedispose()- Clean up resources
TileState Enum
TileState.active- Tile is in active stateTileState.inactive- Tile is in inactive stateTileState.unavailable- Tile is unavailable
π¨ Customization #
Custom Icons #
Place your custom tile icon in android/app/src/main/res/drawable/ic_tile.xml or ic_tile.png
Custom Labels #
Update android/app/src/main/res/values/strings.xml:
<resources>
<string name="tile_label">My Custom Tile</string>
</resources>
π€ Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
π License #
This project is licensed under the MIT License - see the LICENSE file for details.
π¨βπ» Author #
Puneet Sharma
- Email: developer.puneet.sharma@gmail.com
- GitHub: @iamapuneet
π Acknowledgments #
- Thanks to the Flutter community for inspiration and support
- Built with β€οΈ for Flutter developers
π± Platform Support #
| Platform | Support |
|---|---|
| Android | β Yes |
| iOS | β No |
| Web | β No |
| Windows | β No |
| macOS | β No |
| Linux | β No |
π Issues and Feedback #
Please file issues, bugs, or feature requests in our issue tracker.
β Show Your Support #
If this package helped you, please give it a β on GitHub!
Made with β€οΈ by Puneet Sharma
