basf_flutter_components 0.0.1+1 copy "basf_flutter_components: ^0.0.1+1" to clipboard
basf_flutter_components: ^0.0.1+1 copied to clipboard

outdated

A collection of BASF Style components.

basf_flutter_components #

pub email

A BASF Flutter components library for iOS and Android

Installing #

Add BASF Flutter Components to your pubspec.yaml file:

dependencies:
  basf_flutter_components:

Import it the library to your file:

import 'package:basf_flutter_components/basf_flutter_components.dart';

Use your IDE IntelliSense to import any of the Components built into the library


Getting Started #

iOS Setup #

Specify the platform target in Podfile

platform :ios, '11.0'

Android Setup #

Ensure your MainActivity.kt/.java file class extends from FlutterFragmentActivity

Java

public class MainActivity extends FlutterFragmentActivity {
	// Your code...
}

Kotlin

class MainActivity : FlutterFragmentActivity() {
	// Your code...
}

Remember to add the import at the top of the MainActivity file

import io.flutter.embedding.android.FlutterFragmentActivity;

Components #

  • Widgets

    • BASFBUTTON...
    code example here
    
    • BASFTextButton...
    code example here
    
    • BASFTextField...
    code example here
    
    • BASFSnackbar...
    code example here
    

    ... etc...

    • Spacers
    // Vertical Spacers
    VerticalSpacer.xSmall()
    VerticalSpacer.small()
    VerticalSpacer.normal()
    VerticalSpacer.semi()
    VerticalSpacer.mediumSmall()
    VerticalSpacer.medium()
    VerticalSpacer.medium20()
    VerticalSpacer.mediumLarge()
    VerticalSpacer.large()
    VerticalSpacer.xLarge()
    VerticalSpacer.xxLarge()
    VerticalSpacer.xxxLarge()
    // Horizontal Spacers
    HorizontalSpacer.small()
    HorizontalSpacer.normal()
    HorizontalSpacer.semi()
    HorizontalSpacer.mediumSmall()
    HorizontalSpacer.medium()
    HorizontalSpacer.medium20()
    HorizontalSpacer.mediumLarge()
    HorizontalSpacer.large()
    HorizontalSpacer.xLarge()
    HorizontalSpacer.xxLarge()
    // Horizontal Spacer with text
    HorizontalSpacerWithText(
      text: 'example text',
      color: Colors.green,
    )
    ```
    
  • Colors

    BASFColors.blue
    BASFColors.red
    BASFColors.black
    BASFColors.grey
    
  • Theme

    BasfTheme.blue
    BasfTheme.green
    
  • TextStyles

    BASFTextStyle.headline1
    BASFTextStyle.bodyText1
    
  • Styles

    • Dimens

    Defines a preset of usefull standard paddings

    Dimens.paddingXSmall
    Dimens.paddingSmall
    Dimens.paddingDefault
    Dimens.paddingSemi
    Dimens.paddingMediumSmall
    Dimens.paddingMedium
    Dimens.paddingMedium20
    Dimens.paddingMediumLarge
    Dimens.paddingLarge
    Dimens.paddingXLarge
    Dimens.paddingXXLarge
    Dimens.paddingXXXLarge
    
  • One Trust

    • initOneTrust

    Initialize OneTrust on your app

    await initOneTrust(
      domainIdentifier: Environment.otAppId,
      sdks: [
        Sdk(
          categoryId: 'S0002',
          changeSdkStatus: (status) {
            // Turn off SDK's depending on state
            logger.i('Crashlytics status: $status');
            FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(status);
          },
        ),
      ],
      languageCode: 'es',
      onInitParams: {
        //Params are not required
        'countryCode': 'US',
        'regionCode': 'CA',
      },
      storageLocation: 'my.domain.com', // usually 'cdn.cookielaw.org'
    );
    
    • OneTrustWidget

    A Widget that can be placed anywhere on the app and opens up the OneTrust Preference Center

    const OneTrustWidget(
      widget: Text('Open preference center'),
      widgetType: OneTrustUIWidget.preferenceCenter,
    );
    
  • Logger

Based on logger, ready to use Small, easy to use and extensible logger which prints beautiful logs

logger.v('Verbose log...');
logger.d('Debug log');
logger.i('Info log...');
logger.w('Warning log');
logger.e('Error log...');
logger.wtf('👾 What a terrible failure log');
  • Extensions

We also have some extensions

  • Colors
// Get a Color from Hex value
HexColor.fromHex('#ffffff');

// Darken your color
Color myColor = darken(Colors.red, 0.2);
// or lighten it
Color myColor = lighten(Colors.red, 0.2);
  • Strings
String myString = 'this is my string'.toCapitalized; // This is my string
// or
String myString = 'this is my string'.toTitleCase; // This Is My String
11
likes
0
pub points
59%
popularity

Publisher

unverified uploader

A collection of BASF Style components.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, logger, onetrust_publishers_native_cmp

More

Packages that depend on basf_flutter_components