push_widgets 0.1.2 copy "push_widgets: ^0.1.2" to clipboard
push_widgets: ^0.1.2 copied to clipboard

Prefixed widgets (PW*) and Material 3 theme for Flutter apps.

push_widgets #

Prefixed Flutter widgets (PW*) and a shared Material 3 theme you can reuse across apps. The goal is consistency, clarity, and collision-free names.

Features #

  • Categorized folders: basic, input, layout, navigation, dialog, animation, cupertino, material, advanced, utils
  • Common theme system (PWTheme.light, PWTheme.dark) using Material 3
  • Public exports via lib/push_widgets.dart
  • Example app under /example showing usage and self-testing
  • Clear code comments and structure for maintainability
  • New widgets: PWRow, PWColumn, showPWSnackBar, showPWBottomSheet

Folder Structure #

push_widgets/
├── lib/
│   ├── push_widgets.dart
│   └── src/
│       ├── theme/
│       │   └── pw_theme.dart
│       ├── basic/
│       │   └── pw_text.dart
│       ├── input/
│       │   └── pw_button.dart
│       ├── navigation/
│       │   └── pw_app_bar.dart
│       ├── layout/
│       │   └── index.dart
│       ├── dialog/
│       │   └── index.dart
│       ├── animation/
│       │   └── index.dart
│       ├── cupertino/
│       │   └── index.dart
│       ├── material/
│       │   └── index.dart
│       ├── advanced/
│       │   └── index.dart
│       └── utils/
│           ├── index.dart
│           └── pw_spacers.dart
├── example/
│   ├── pubspec.yaml
│   └── lib/
│       └── main.dart
├── test/
│   └── push_widgets_test.dart
├── pubspec.yaml
├── README.md
├── CHANGELOG.md
└── LICENSE

Installation (another project) #

Add to your app's pubspec.yaml after published:

dependencies:
  push_widgets: ^0.1.2

Import in code:

import 'package:push_widgets/push_widgets.dart';

Quick Usage #

  • Theme:
MaterialApp(
  theme: PWTheme.light,
  darkTheme: PWTheme.dark,
  themeMode: ThemeMode.system,
)
  • Text:
const PWText('Hello PWText', textAlign: TextAlign.center);
  • Button:
PWButton(onPressed: () {}, child: const Text('Click Me'));
  • AppBar:
Scaffold(appBar: const PWAppBar(title: 'push_widgets'));
  • Row with spacing:
const PWRow(gap: 8, children: [PWText('A'), PWText('B'), PWText('C')]);
  • Column with spacing:
const PWColumn(gap: 12, children: [PWText('1'), PWText('2'), PWText('3')]);
  • SnackBar helper:
showPWSnackBar(context, 'Saved!', action: SnackBarAction(label: 'Undo', onPressed: () {}));
  • Bottom sheet helper:
showPWBottomSheet(
  context,
  child: Padding(
    padding: const EdgeInsets.all(16),
    child: Column(
      mainAxisSize: MainAxisSize.min,
      children: const [PWText('Sheet title'), PWSpacer.h(8), PWText('Sheet body')],
    ),
  ),
);

Example App (self-test) #

Run the local example that depends on ../:

cd example
flutter run

Use the "Toggle Theme" button to switch between light/dark.

Publish to pub.flutter-io.cn (step-by-step) #

  1. Ensure metadata is complete in pubspec.yaml (name, description, version, homepage, repository, topics).
  2. Update README.md, CHANGELOG.md, and ensure LICENSE is present.
  3. Run a dry run:
    flutter pub publish --dry-run
    
  4. Fix any issues reported.
  5. Publish:
    flutter pub publish
    

Create and Structure the Package (step-by-step) #

  1. Create the package skeleton:
    flutter create --template=package push_widgets
    
  2. Add categorized folders under lib/src/ as shown above.
  3. Implement sample widgets (PWText, PWButton, PWAppBar) and the PWTheme.
  4. Export everything via lib/push_widgets.dart.
  5. Create an /example app that depends on path: ../.
  6. Write docs in README.md and notes in CHANGELOG.md.

Import and Use in Another Flutter Project #

  1. Add dependency in pubspec.yaml (published version or local path).
  2. Import: import 'package:push_widgets/push_widgets.dart';
  3. Use PWTheme for Material 3 theming, and PWText, PWButton, PWAppBar in your UI.

Contributing & Issues #

License #

MIT License (see LICENSE).

What’s New #

  • 0.1.2: Add PWRow, PWColumn, showPWSnackBar, showPWBottomSheet and update example.
  • 0.1.1: Analyzer cleanup and docs fixes.
  • 0.1.0: Initial release.
2
likes
160
points
8
downloads

Publisher

unverified uploader

Weekly Downloads

Prefixed widgets (PW*) and Material 3 theme for Flutter apps.

Repository (GitHub)
View/report issues

Topics

#widget #ui #material3 #theming #cupertino

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on push_widgets