Skip to main content

C2CCore

Overview

C2CCore is a widget that provides the theme for the entire application. It is usually used as the root widget of the application.

Configure the theme for the entire application

void main() {
runApp(const MyApp());
}

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

// This widget is the root of your application.

Widget build(BuildContext context) {
// Add custom theme data
final c2cTheme = C2CThemeData(
textTheme: const C2CTextThemeData(fontFamily: 'NotoSansJP'),
colors: const C2CColorThemeData(
primary1: Color.fromRGBO(234, 247, 255, 1),
primary2: Color.fromRGBO(47, 121, 234, 1),
primary3: Color.fromRGBO(0, 80, 201, 1),
primary4: Color.fromRGBO(10, 66, 149, 1),
),
// ... other theme data
);
return MaterialApp(
title: 'Flutter UIKits Demo',
theme: c2cTheme.materialThemeData,
builder: C2CCore.init(theme: c2cTheme),
home: const MyHomePage(title: 'Flutter UIKits Demo Home Page'),
);
}
}

Use theme

Widget build(BuildContext context) {
final c2cTheme = C2CTheme.of(context);
return Container(color: c2cTheme.colors.primary3);
}

C2CThemeData Properties

PropertyTypeDescription
textThemeC2CTextThemeDataThe text theme for C2C UIKits.
colorsC2CColorThemeDataThe color theme for C2C UIKits.
inputThemeC2CInputThemeDataThe theme for the input widgets.
primaryButtonThemeC2CPrimaryButtonThemeDataThe theme for the primary button.
secondaryButtonThemeC2CSecondaryButtonThemeDataThe theme for the secondary button.
imageThemeC2CImageThemeDataThe theme for the image widgets.
bottomTabsThemeC2CBottomTabsThemeDataThe theme for the bottom tabs.
checkboxThemeC2CCheckboxThemeDataThe theme for the checkbox widgets.
radioThemeC2CRadioThemeDataThe theme for the radio widgets.
switchThemeC2CSwitchThemeDataThe theme for the switch widgets.
selectThemeC2CSelectThemeDataThe theme for the select widgets.
toastThemeC2CToastThemeDataThe theme for the toast widgets.
dialogThemeC2CDialogThemeDataThe theme for the dialog widgets.
stepperThemeC2CStepperThemeDataThe theme for the stepper widgets.
datePickerThemeC2CDatePickerThemeDataThe theme for the date picker widgets.