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

SZ Core is a lightweight Flutter utility package that simplifies application development in one package.

example/lib/main.dart

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

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  SZCore.init();
  SZApiSetting.init(
    "",
    keyStatus: "status", //default status
    keyMessage: "message", //default message
    keyData: "data", //default data
    keyInternet: "internet", //default internet
  );

  SZCore.printLog(SZCore.formattedTime(DateTime.timestamp(), server: false));
  SZCore.printLog(SZCore.formattedTime(DateTime.timestamp()));
  SZCore.printLog((await SZCore.getDeviceInfo()).toString());
  SZCore.printLog((await SZCore.getDefaultHeader()).toString());
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  int count = 0;
  String text = "";

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Plugin example app')),
        body: Padding(
          padding: EdgeInsets.all(10),
          child: Column(
            children: [
              InkWell(
                onTap: () async {
                  var a = await SZCore.getScreenSize();
                  text = "${a.height}X${a.width}";
                  setState(() {
                    count++;
                  });
                  SZShow.toast("Test $count");
                },
                child: Text('COUNT : $count\n\n$text'),
              ),
              SZTextField(
                hint: "Test",
                bgColor: Colors.black,
                borderWidth: 0.1,
                suffixIcon: Icons.lock,
                height: 38.h,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
160
points
572
downloads

Documentation

API reference

Publisher

verified publishersoftozin.com

Weekly Downloads

SZ Core is a lightweight Flutter utility package that simplifies application development in one package.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, http, intl, plugin_platform_interface, url_launcher

More

Packages that depend on sz_core

Packages that implement sz_core