ui_mate 0.0.8 copy "ui_mate: ^0.0.8" to clipboard
ui_mate: ^0.0.8 copied to clipboard

A Flutter UI helper package with widgets like buttons, text inputs, toast, snackbar, navigation, etc.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:ui_mate/ui_mate.dart';
import 'package:ui_mate/widgets/btn.dart';
import 'package:ui_mate/widgets/divider.dart';
import 'package:ui_mate/widgets/get_image.dart';
import 'package:ui_mate/widgets/loader.dart';
import 'package:ui_mate/widgets/txt.dart';
import 'package:ui_mate/widgets/txt_input.dart';
import 'package:ui_mate/dialogs/overlay_loading.dart';

void main() {
  uiSetSetting(
    primaryColor: Colors.blue,
    secondaryColor: Colors.black,

  );
  runApp(const ExampleApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'UI Mate Example',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const ExampleHomePage(),
    );
  }
}

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

  @override
  State<ExampleHomePage> createState() => _ExampleHomePageState();
}

class _ExampleHomePageState extends State<ExampleHomePage> {
  final TextEditingController _controller = TextEditingController();
  bool isLoading = true;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(title: const Text("UI Mate Example")),
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              // Txt Example
              const Txt(
                "πŸ‘‹ Welcome to UI Mate",
                textColor: Colors.blue,
                fontSize: 20,
                fontWeight: FontWeight.w600,
              ),
              const MyDivider(height: 20),

              // TextInput Example
              TxtFormInput(
                controller: _controller,
                hintText: "Enter your name",
                onChanged: (val) {
                  debugPrint("Input changed: $val");
                },
              ),
              MyDivider(),
              MyDivider(),
              Btn(text: 'Text Submit',
                onPressed: (){},
                isLoading: true,
                bgColor: Colors.orange,
                loaderColor: Colors.green,
                decorationColor: Colors.amber,
                hasBorder: false,
                textDecoration: TextDecoration.underline,
                textColor: Colors.red,),
              // Button Example
              Btn(
                text: "",
                textColor: Colors.red,
                radius: 100,
                hasBorder: false,
                borderColor: Colors.red,
                preFix: Icon(Icons.access_alarm_outlined,size: 28,),
                isLoading: true,
                //loadingColor: Colors.red,
                onPressed: () {
                  if (_controller.text.isEmpty) {
                  } else {
                    pShowToast(
                      message: "βœ… Hello, ${_controller.text}!",
                    );
                  }
                },
              ),
              const SizedBox(height: 20),

              // Another Button Example
              Btn(
                text: "Show Info Snackbar",
                bgColor: Colors.green,
                textColor: Colors.white,
                onPressed: () async {
                  LoadingOverlay.show(context,backgroundColor: Colors.black.withOpacity(0.8),body: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Text('Loading, please wait...',style: TextStyle(color: Colors.white),),
                      MyDivider(),
                      LoadingPro(valueColor: Colors.white,)
                    ],
                  ),);
                  await Future.delayed(const Duration(seconds: 6));
                  LoadingOverlay.hide();

                },
              ),
              const SizedBox(height: 20),
              GetImage(
                imagePath: 'https://plus.unsplash.com/premium_photo-1664474619075-644dd191935f?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2069',
                width: double.infinity,
                height: 400,
                radius: 20,
                fit: BoxFit.cover,
                appBar: AppBar(title: Text('my app bar'),backgroundColor: Colors.black,),
              )
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
130
points
299
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter UI helper package with widgets like buttons, text inputs, toast, snackbar, navigation, etc.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

cached_network_image, cupertino_icons, flutter, fluttertoast, intl, photo_view, shared_preferences, shimmer, url_launcher

More

Packages that depend on ui_mate