timed_widget 0.1.1 copy "timed_widget: ^0.1.1" to clipboard
timed_widget: ^0.1.1 copied to clipboard

A collection of reusable Flutter widgets for timed interactions: delayed visibility, switchers, sequencers, animations and more.

example/lib/main.dart

import 'package:example/screens/timed_animated_builder_example.dart';
import 'package:example/screens/timed_builder_example.dart';
import 'package:example/screens/timed_function_example.dart';
import 'package:example/screens/timed_repeat_builder_example.dart';
import 'package:example/screens/timed_sequence_example.dart';
import 'package:example/screens/timed_switcher_example.dart';
import 'package:example/screens/timed_visibility_example_screen.dart';
import 'package:flutter/material.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Timed Widget Showcase',
      theme: ThemeData.light(useMaterial3: true),
      home: const ShowcaseHome(),
      debugShowCheckedModeBanner: false,
    );
  }
}

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

  final tabs = const [
    'Visibility',
    'Switcher',
    'Builder',
    'Function',
    'Animated',
    'Repeat',
    'Sequence',
  ];

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: tabs.length,
      child: Scaffold(
        appBar: AppBar(
          title: const Text('⏱️ Timed Widget Showcase'),
          bottom: TabBar(
            isScrollable: true,
            tabs: tabs.map((title) => Tab(text: title)).toList(),
          ),
        ),
        body: Container(
          color: Colors.grey[100],
          child: const TabBarView(
            children: [
              TimedVisibilityExample(),
              TimedSwitcherExample(),
              TimedBuilderExample(),
              TimedFunctionExample(),
              TimedAnimatedBuilderExample(),
              TimedRepeatBuilderExample(),
              TimedSequenceExample(),
            ],
          ),
        ),
      ),
    );
  }
}

// 🔹 Helper widget for layout
class ExampleScaffold extends StatelessWidget {
  final String title;
  final String description;
  final Widget child;

  const ExampleScaffold({
    super.key,
    required this.title,
    required this.description,
    required this.child,
  });

  @override
  Widget build(BuildContext context) {
    return Center(
      child: SingleChildScrollView(
        padding: const EdgeInsets.all(24),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Card(
              elevation: 3,
              color: Colors.white,
              child: Padding(
                padding: const EdgeInsets.all(16),
                child: Column(
                  children: [
                    Text(
                      title,
                      style: const TextStyle(
                        fontSize: 20,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    const SizedBox(height: 8),
                    Text(
                      description,
                      style: const TextStyle(fontSize: 14),
                      textAlign: TextAlign.center,
                    ),
                  ],
                ),
              ),
            ),
            const SizedBox(height: 24),
            child,
          ],
        ),
      ),
    );
  }
}
4
likes
155
points
29
downloads

Publisher

unverified uploader

Weekly Downloads

A collection of reusable Flutter widgets for timed interactions: delayed visibility, switchers, sequencers, animations and more.

Repository (GitHub)
View/report issues

Topics

#timer #animation #visibility #flutter-widget

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on timed_widget