miniriverpod ஐ சில நிமிடங்களில் நிறுவுங்கள்.

ஒரே-கோப்பு core மற்றும் இலகு Flutter binding உடன் உள்ள லைட் Riverpod-ஸ்டைல் state management toolkit.

தேவைகள்

உங்கள் திட்டம் குறைந்தபட்ச SDK மற்றும் Flutter பதிப்புகளை பூர்த்தி செய்கிறது என உறுதி செய்யவும்.

Dart SDK

>=3.10.0 <4.0.0

Flutter

>=3.38.0

குறிப்பு

ஏற்கனவே உள்ள திட்டத்தை மேம்படுத்துகிறீர்கள் என்றால், install கமாண்டை இயக்குவதற்கு முன் SDK constraints ஐ புதுப்பிக்கவும்.

நிறுவல்

Flutter CLI மூலம் பேக்கேஜை சேர்க்கவும் அல்லது pubspec ஐ கைமுறையாக புதுப்பிக்கவும்.

CLI

flutter pub add miniriverpod

pubspec.yaml

# Add to your dependencies
dependencies:
  miniriverpod: ^0.0.1

முதல் படிகள்

ProviderScope ஐ இணைத்து, Provider ஐ அறிவித்து, UI-ல் இருந்து பார்க்கவும்.

main.dart
// 1) Wrap your app with ProviderScope
void main() {
  runApp(
    const ProviderScope(
      child: MyApp(),
    ),
  );
}

// 2) Define a Provider
final counterProvider = Provider<int>((ref) => 0);

// 3) Watch from UI
class MyApp extends ConsumerWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final count = ref.watch(counterProvider);
    return Directionality(
      textDirection: TextDirection.ltr,
      child: Center(child: Text('$count')),
    );
  }
}
Provider((ref) => ...) synchronous ஆகும்.
AsyncProvider<T>((ref) async => ...) Future அல்லது Stream ஐ கையாளும்.
UI இலிருந்து WidgetRef.watch(provider) பயன்படுத்தி subscribe செய்யவும்.

அடுத்த படிகள்

பயன்பாட்டு வழிகாட்டு

miniriverpod ஏன் Riverpod போலவே இருந்தும் overhead இல்லாமல் இருக்கும் என்பதை அறிக.

வழிகாட்டை திறக்க

GitHub

ரெபோவில் source, changelog, samples பார்க்கவும்.

GitHub திறக்க

API Reference

Quickly lookup methods such as invalidate, refreshValue, keepAlive, and invoke.

Open API Reference