flutterx_live_data 1.0.0-dev flutterx_live_data: ^1.0.0-dev copied to clipboard
A new Flutter project.
flutterx_live_data #
LiveData flutter implementation.
Install #
Add a line like this to your package's pubspec.yaml (and run dart pub get):
dependencies:
flutterx_live_data: ^1.0.0-dev
Import #
Import the library like this:
import 'package:flutterx_live_data/flutterx_live_data.dart';
Usage #
The most easy example of usage of this library is:
import 'package:flutterx_live_data/flutterx_live_data.dart';
class TestWidget extends StatefulWidget {
const TestWidget({Key? key}) : super(key: key);
@override
State<TestWidget> createState() => _TestWidgetState();
}
class _TestWidgetState extends State<TestWidget> {
final MutableLiveData<int> myCounter = MutableLiveData(initialValue: 0);
@override
Widget build(BuildContext context) => Scaffold(
body: Center(
child: LiveDataBuilder<int>(data: myCounter, builder: (context, value) => Text('pressed $value times'))),
floatingActionButton: FloatingActionButton(onPressed: () => myCounter.value++));
}
But it can do much more, please check the documentation in the desired source file of this library