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

retracted

SZ Core Package

SZ Core #

A lightweight Flutter package that provides reusable base classes and utilities to speed up application development.

Features #

  • ✅ Common base classes for Flutter applications.
  • ✅ Reusable utility methods.
  • ✅ Cleaner and more maintainable code.
  • ✅ Easy to extend and customize.

Included Classes #

  • SZActivity
  • SZFragment
  • SZCore
  • SZText
  • SZButton
  • SZIconButton
  • SZTextField

Installation #

Add the package to your pubspec.yaml:

dependencies:
  sz_core: ^1.0.0

Then run:

flutter pub get

Import #

import 'package:sz_core/sz_core.dart';

Init SZCore in MyApp #

SZCore.init() //Pass context

Usage #

SZCore #

  • use below methods

🔵 void showDialog(String msg)

🔵 void hideDialog()

🔵 Future<A?> open(A dyClass)

🔵 void onResume()

🔵 void onPaused()

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

  @override
  State<HomeActivity> createState() => _HomeActivityState();
}

class _HomeActivityState extends SZActivity<HomeActivity> {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return const SizedBox();
  }
}

SZActivity #

  • Replace State with SZActivity
  • Replace build with buildContent
  • use below methods

🔵 Future<A?> open(A dyClass)

🔵 void onResume()

🔵 void onPaused()

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

  @override
  State<HomeActivity> createState() => _HomeActivityState();
}

class _HomeActivityState extends SZActivity<HomeActivity> {
  const HomePage({super.key});

  @override
  Widget buildContent(BuildContext context) {
    return const SizedBox();
  }
}

SZFragment #

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

  @override
  State<HomeActivity> createState() => _HomeFragmentState();
}

class _HomeFragmentState extends SZFragment<HomeFragment> {
  const HomeFragment({super.key});

  @override
  Widget buildContent(BuildContext context) {
    return const SizedBox();
  }
}

Requirements #

  • Flutter SDK >=3.0.0

Contributing #

Contributions, issues, and feature requests are welcome.

License #

This project is licensed under the MIT License. See the LICENSE file for details.