sync_ease 0.0.6 copy "sync_ease: ^0.0.6" to clipboard
sync_ease: ^0.0.6 copied to clipboard

A lightweight Flutter State Management library for simplified state handling in Flutter applications.

SyncEase #

enter image description here SyncEase is a lightweight and versatile state management library for Flutter applications. It provides simple yet powerful tools for managing the state of your application with ease.

Features #

  • Simple API: SyncEase offers a straightforward API for managing state, making it easy to integrate into your Flutter projects.
  • Error Handling: Easily handle errors within your application state and propagate them to your UI.
  • Loading State: Manage loading states within your application, providing feedback to users during asynchronous operations.
  • Batch Operations: Perform batch operations on your state, allowing you to update multiple values atomically.
  • Listener Support: SyncEase supports listeners, allowing you to react to state changes and update your UI accordingly.
  • Versatile: Suitable for various types of state management scenarios, including simple value states and list states.

Installation #

To use SyncEase in your Flutter project, add the following dependency to your pubspec.yaml file:

dependencies:
  sync_ease: ^1.0.0`

Then, run flutter pub get to install the package.

Usage #

Here's a simple example of how to use SyncEase to manage state in your Flutter application:

1. Import SyncEase #

import 'package:sync_ease/sync_ease.dart';

2. Create an Instance of Ease #

final Ease<int> counter = Ease(0);

3. Use EaseBuilder to React to State Changes #

 EaseBuilder<int>(
  ease: counter,
  builder: (context, value) => Text(
    value.toString(),
    style: TextStyle(fontSize: 24),
  ),
),

4. Update State Values #

counter.value++; // Increment the counter

Counter App With SyncEase #

import 'package:flutter/material.dart';  
import 'package:sync_ease/sync_ease.dart';  
  
class CounterLogic extends SyncEaseLogic{  
int a=0;  
  
increment(){  
a++;  
put(); // update Logic Builder Widget  
}  
}  
  
class MyApp extends StatelessWidget{  
final CounterLogic _counterLogic=SyncEaseLogic.reg(CounterLogic());  
  
MyApp({super.key});  
@override  
Widget build(BuildContext context) {  
	return Scaffold(  
		floatingActionButton: FloatingActionButton(  
		child: const Icon(Icons.add),  
		onPressed: (){  
		_counterLogic.increment();  
		},  
	),  
	body: Center(  
	child: LogicBuilder(  
	logic: _counterLogic,  
	builder: (BuildContext context) {  
	return Text(_counterLogic.a.toString());  
	},  
	)  
	),  
	);  
}  
  
}

Advantages #

  • Simplicity: SyncEase offers a simple and intuitive API, making it easy to manage state in Flutter applications.
  • Flexibility: It provides various features like error handling, loading state management, and batch operations, catering to diverse state management needs.
  • Efficiency: With its listener support and batch operations, SyncEase ensures efficient state updates and UI rendering.
  • Compatibility: SyncEase seamlessly integrates with existing Flutter projects and other state management solutions, allowing for smooth adoption.
  • Show Snack Bar, Alert Dialog, and Date Picker Anywhere in the App

Dialogs #

Show Snack Bar, Alert Dialog, and Date Picker Anywhere in the App #

You can now use the showSyncSnackBar, showSyncAlertBox, and showSyncDatePicker functions to display snack bars, alert dialogs, and date pickers from anywhere in the app, even outside the widget tree.

Example

showSyncSnackBar(SnackBar(content: Text('Hello, world!')));

showSyncAlertBox(
  builder: (BuildContext context) => AlertDialog(
    title: Text('Alert'),
    content: Text('This is an alert dialog.'),
  ),
);

showSyncDatePicker(
  initialDate: DateTime.now(),
  firstDate: DateTime(2022),
  lastDate: DateTime(2025),
);

Simple Navigation #

to(SecondPage());
to(SecondPage(),asrguments:{"name":"Jhone"});
back();

Documentation #

For detailed documentation and API reference, visit the SyncEase Documentation.

Contributing #

Contributions to SyncEase are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request on GitHub.

12
likes
0
points
31
downloads

Publisher

verified publishermypackeges.tk

Weekly Downloads

A lightweight Flutter State Management library for simplified state handling in Flutter applications.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on sync_ease