custom_styles_package 0.0.4 copy "custom_styles_package: ^0.0.4" to clipboard
custom_styles_package: ^0.0.4 copied to clipboard

A Custom Styles Flutter package containing reusable and customizable UI components for custom styling like CustomText, CustomImage, CustomTextField, CustomButton, and more with global styling support. [...]

example/lib/main.dart

import 'package:custom_styles_package/custom_styles_package.dart';
import 'package:custom_styles_package/functions/print_function.dart';
import 'package:custom_styles_package/theme/custom_decorations.dart';
import 'package:custom_styles_package/theme/custom_text_styles.dart';
import 'package:flutter/material.dart';

void main() {

  CustomDecorations.init(
    textfieldInputDecoration: InputDecoration(

      // contentPadding: EdgeInsets.symmetric(horizontal: 16),
    )
  );
  CustomStylesConfig.init(primary: Colors.black,isDarkMode: true,fontSize: 14 );
  // CustomStylesConfig.init(primary: Colors.black,isDarkMode: true,fontSize: 14 );
  runApp(const MyApp());
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return CustomScreenUtil(
      designSize: const Size(390, 850),
      child: MaterialApp(
        title: 'Custom Styling Demo',
        theme: ThemeData(
          colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        ),
        home: const MyHomePage(title: 'App bar title'),
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {





  @override
  void initState() {
    // TODO: implement initState


    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        // backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: CustomText.appbarText(widget.title), // use this widget to show app bar title
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            CustomText.heading('Heading Text'),// use this widget to show headings
            CustomText.bodyText1('Bodydf Text 1'),// use this widget to body text 1
            CustomText.bodyText2('Body Text 2'),// use this widget to body text 2
            CustomTextField(controller: TextEditingController(), hintText: 'Type something here',prefix: Icon(Icons.abc),),
            CustomRichText(firstText: 'Hello this is first text', secondText: 'This is second text'),
            CustomButton(text: 'Submit', onTap: (){
              customPrint('Submit button pressed');
            },
              borderRadius: 12,
              color: Colors.green,
              // textColor: Colors.yellow,
            )// use this to show button
          ],
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
16
likes
0
points
273
downloads

Publisher

verified publishermanishtalreja.in

Weekly Downloads

A Custom Styles Flutter package containing reusable and customizable UI components for custom styling like CustomText, CustomImage, CustomTextField, CustomButton, and more with global styling support. The best part of the package is that you can completely customize each and every part of widget in config for setting globally and in individual widgets as well.

Homepage

License

unknown (license)

Dependencies

cached_network_image, flutter, flutter_screenutil

More

Packages that depend on custom_styles_package