theme function
origin: kt_ifm_gtid_mob/lib/theme.dart union-of: stm_portal_mob/lib/theme.dart author: anovsiradj, webheadzero, opencode-go/glm-5.2 version: 2024-07-15, revised: 2026-08-17
Default ThemeData builder. Brand red #B70000 (STM/kt_ifm convention).
Override themeColor / themeSecondColor consts above for other brands.
Implementation
ThemeData theme(BuildContext context) {
final inputDecorationBorder = OutlineInputBorder(
gapPadding: 0,
borderSide: const BorderSide(color: Colors.black38, width: 0.5),
borderRadius: BorderRadius.circular(5),
);
return ThemeData(
fontFamily: GoogleFonts.dmSans().fontFamily,
colorScheme: ColorScheme.fromSeed(seedColor: themeColor),
scaffoldBackgroundColor: Colors.white,
appBarTheme: const AppBarTheme(
iconTheme: IconThemeData(color: Colors.white),
backgroundColor: themeColor,
elevation: 0,
centerTitle: true,
titleTextStyle: TextStyle(fontSize: 12, color: Colors.white, fontWeight: FontWeight.bold),
),
inputDecorationTheme: InputDecorationTheme(
contentPadding: const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
floatingLabelAlignment: FloatingLabelAlignment.start,
alignLabelWithHint: true,
border: inputDecorationBorder,
enabledBorder: inputDecorationBorder,
focusedBorder: inputDecorationBorder,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(3)),
backgroundColor: themeColor,
foregroundColor: Colors.white,
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(3)),
),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
backgroundColor: themeColor,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10))),
),
dialogTheme: const DialogThemeData(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5))),
),
);
}