-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
Ivan Galkin edited this page Jan 1, 2024
·
4 revisions
Create and fill the presentational entities you need from the interfaces that this package provides:
class Animations extends FPCDefaultAnimation {
const Animations();
// Override properties
}
class TimesOfDay extends FPCDefaultTimeOfDay {
const TimesOfDay();
// Override properties
}
class DateTimes extends FPCDefaultDateTime {
DateTimes();
// Override properties
}
class Durations extends FPCDefaultDuration {
const Durations();
// Override properties
}
class Haptics extends FPCDefaultHaptic {
const Haptics();
// Override properties
}
class LightTheme extends FPCDefaultLightTheme {
const LightTheme();
// Override properties
}
class Sizes extends FPCDefaultSize {
const Sizes();
// Override properties
}
class Fonts extends FPCDefaultFont {
const Fonts();
// Override properties
}
Initialize the main component widget at the root:
void main() => runApp(
FlutterPlatformComponent( // Initialize the main widget at the root
animation: const Animations(),
timeOfDay: const TimesOfDay(),
dateTime: DateTimes(),
duration: const Durations(),
platform: FPCPlatform.iOS,
haptic: const Haptics(),
theme: LightTheme(),
size: const Sizes(),
font: const Fonts(),
child: const Application(),
),
);
class Application extends StatelessWidget {
const Application({
super.key,
});
@override
Widget build(BuildContext context,) {
return FPCApp(
home: const HomeScreen(),
);
}
}
All basic components are named "FPC{component-name}".
Usage basic components:
FPCButton(
backgroundColor: theme.primary,
splashColor: theme.whiteAlways,
borderRadius: BorderRadius.circular(16),
child: Text("Next"),
onPressed: _next,
),
All ready-made components are named "FPC{color}{component-name}".
Usage ready-made components:
FPCPrimaryButton(
title: "Next",
onPressed: _next,
),
App
AppBar
Badge
Blur
BottomSheet
Button
Card
Checkbox
CodeField
Dialog
Divider
FormField
Global
Gradient
Icon
Indicator
Keyboard
List
Navigation
Picker
PINField
PopUp
Radio
Scaffold
Scrollbar
SegmentControl
SelectCard
SelectField
Shimmer
Slider
SlidingSegmentControl
SliverAppBar
SnackBar
Switch
Text
Toggle