sbadgeview 1.0.1 copy "sbadgeview: ^1.0.1" to clipboard
sbadgeview: ^1.0.1 copied to clipboard

Great flutter badge view for shoung counts of notifications from the database and other counts, including notifications that notify users of anything required attention to.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:sbadgeview/sbadgeview.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
        actions: const [
          SBadgeView(content: Text('data'), badgeCount: 23),
          SBadgeView(content: Icon(Icons.abc_outlined), badgeCount: 23),
        ],
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
2
likes
150
points
29
downloads

Publisher

unverified uploader

Weekly Downloads

Great flutter badge view for shoung counts of notifications from the database and other counts, including notifications that notify users of anything required attention to.

Repository (GitHub)
View/report issues

Topics

#badge #badgeview #actions #allplatforms #counter

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on sbadgeview