s_offstage 1.0.0 copy "s_offstage: ^1.0.0" to clipboard
s_offstage: ^1.0.0 copied to clipboard

A Flutter package for smooth loading/content transitions and content hiding/reveal widgets.

s_offstage #

A Flutter package for smooth loading/content transitions and content hiding/reveal widgets.

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  s_offstage:
    path: ../my_extensions/s_offstage

Usage #

Import the package:

import 'package:s_offstage/s_offstage.dart';

Example #

SOffstage(
  isOffstage: isLoading,
  child: YourContentWidget(),
)

See example/main.dart for a complete runnable example:

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

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'SOffstage Example',
      home: const ExampleHome(),
    );
  }
}

class ExampleHome extends StatefulWidget {
  const ExampleHome({super.key});

  @override
  State<ExampleHome> createState() => _ExampleHomeState();
}

class _ExampleHomeState extends State<ExampleHome> {
  bool _loading = true;

  @override
  void initState() {
    super.initState();
    Future.delayed(const Duration(seconds: 2), () {
      setState(() {
        _loading = false;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('SOffstage Example')),
      body: Center(
        child: SOffstage(
          isOffstage: _loading,
          child: Container(
            padding: const EdgeInsets.all(24),
            color: Colors.green.shade100,
            child: const Text(
              'Loaded content!',
              style: TextStyle(fontSize: 20),
            ),
          ),
        ),
      ),
    );
  }
}

Features #

  • SOffstage widget: Smooth fade transitions between loading and content
  • Customizable loading indicator (default or custom widget)
  • Performance-optimized with Offstage and AnimatedOpacity
  • HiddenContent widget: Hide/reveal content with optional force reveal and custom indicator

License #

MIT License. See LICENSE for details.

Repository #

https://github.com/SoundSliced/s_offstage

0
likes
0
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for smooth loading/content transitions and content hiding/reveal widgets.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, sizer, ticker_free_circular_progress_indicator

More

Packages that depend on s_offstage