Flutter માટે હળવું સ્ટેટ મેનેજમેન્ટ સોલ્યુશન.

કોડ જનરેશન અથવા ભારે ડિપેન્ડન્સીઝ વગર Riverpod ની રિએક્ટિવ આર્કિટેક્ચરનો લાભ મેળવો.

કોઈ કોડ જન નથી

સ્ટાન્ડર્ડ Dart ક્લાસિસ અને providers લખો. build_runner જરૂરી નથી.

હળવું

50KB કરતાં ઓછી ફૂટપ્રિન્ટ. પ્રદર્શન-મહત્વપૂર્ણ એપ્સ માટે ઉત્તમ.

પરિચિત API

Riverpod ની સુંદર state-reading syntax થી પ્રેરિત.

પ્રથમ પગલા

મિનિટોમાં તમારા Flutter પ્રોજેક્ટમાં miniriverpod ઇન્ટિગ્રેટ કેવી રીતે કરવું તે શીખો.

ઇન્સ્ટોલેશન

flutter pub add miniriverpod

ઉપયોગ માર્ગદર્શિકા

user_provider.dart
import 'package:flutter/widgets.dart';
import 'package:miniriverpod/miniriverpod.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')),
    );
  }
}
મહત્વપૂર્ણ નોંધ

મૂળ Riverpodથી અલગ રીતે, miniriverpod ખાસ Flutter એપ્સને ટાર્ગેટ કરે છે અને standalone Dart પ્રોજેક્ટ્સને સપોર્ટ કરતું નથી. આથી અમે વધારે પ્રદર્શન માટે આંતરિક લોજિકનું 70% ઘટાડ્યું છે.

પાછલું

Welcome