push_widgets 0.1.2
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
/exampleshowing 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) #
- Ensure metadata is complete in
pubspec.yaml(name, description, version, homepage, repository, topics). - Update
README.md,CHANGELOG.md, and ensureLICENSEis present. - Run a dry run:
flutter pub publish --dry-run - Fix any issues reported.
- Publish:
flutter pub publish
Create and Structure the Package (step-by-step) #
- Create the package skeleton:
flutter create --template=package push_widgets - Add categorized folders under
lib/src/as shown above. - Implement sample widgets (
PWText,PWButton,PWAppBar) and thePWTheme. - Export everything via
lib/push_widgets.dart. - Create an
/exampleapp that depends onpath: ../. - Write docs in
README.mdand notes inCHANGELOG.md.
Import and Use in Another Flutter Project #
- Add dependency in
pubspec.yaml(published version or local path). - Import:
import 'package:push_widgets/push_widgets.dart'; - Use
PWThemefor Material 3 theming, andPWText,PWButton,PWAppBarin your UI.
Contributing & Issues #
- Issues: https://github.com/pushparajmanickam/push_widgets/issues
- Pull requests are welcome. Keep the
PWprefix convention and Material 3 alignment.
License #
MIT License (see LICENSE).
What’s New #
- 0.1.2: Add
PWRow,PWColumn,showPWSnackBar,showPWBottomSheetand update example. - 0.1.1: Analyzer cleanup and docs fixes.
- 0.1.0: Initial release.