opening_hour_display_widget 0.0.3 copy "opening_hour_display_widget: ^0.0.3" to clipboard
opening_hour_display_widget: ^0.0.3 copied to clipboard

A Flutter plugin to display opening hours of a business, with a customizable design.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Open Hour Display Widget Example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blueAccent),
        useMaterial3: true,
      ),
      home:
          const MyHomePage(title: 'Open Hour Display Widget Example 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> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: const Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'Find out if the store is open or closed',
            ),
            SizedBox(
              width: 220,
              child: OpeningHourDisplayWidget(
                boxWidth: 210,
                openTitle: "Open",
                closeTitle: "Closed",
                openDescription: "We'll be closed on 6:00 PM",
                closeDescription: "We'll be open on 9:00 AM",
                openHour: 9,
                closeHour: 18,
                iconSize: 20,
                openColor: Colors.green,
                closeColor: Colors.red,
              ),
            )
          ],
        ),
      ),
    );
  }
}
1
likes
150
points
22
downloads

Publisher

verified publisherhery.website

Weekly Downloads

A Flutter plugin to display opening hours of a business, with a customizable design.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on opening_hour_display_widget