skeletonprovider 0.0.1
skeletonprovider: ^0.0.1 copied to clipboard

Straight forward package that help you deal with provider UI build

example/lib/main.dart

import 'package:exmaple/countProvider.dart';
import 'package:flutter/material.dart';
import 'package:skeletonprovider/skeletonprovider.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SkeletonWidget<CountProvider>(
      provider: CountProvider(),
      onProviderReady: (provider) => provider.updateTitle(),
      builder: (context, provider, child) => Scaffold(
        appBar: AppBar(
          title: Text(provider.title),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'You have pushed the button this many times:',
              ),
              Text(
                provider.count.toString(),
                style: Theme.of(context).textTheme.headline4,
              ),
            ],
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: provider.incrementCounter,
          tooltip: 'Increment',
          child: Icon(Icons.add),
        ),
      ),
    );
  }
}
0
likes
90
pub points
13%
popularity

Straight forward package that help you deal with provider UI build

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, provider

More

Packages that depend on skeletonprovider