Advertisement
estevaorada

Exemplo: ThemeData

Sep 4th, 2024
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.70 KB | None | 0 0
  1. MaterialApp(
  2.       title: 'Meu  
  3. App Personalizado',
  4.       theme: ThemeData(
  5.         // Cores primárias e secundárias
  6.         primaryColor: Colors.deepPurple,
  7.         accentColor: Colors.orange,
  8.  
  9.         // Barra de aplicativos
  10.         appBarTheme: AppBarTheme(
  11.           backgroundColor: Colors.deepPurple,
  12.           titleTextStyle: TextStyle(
  13.             color: Colors.white,
  14.             fontSize: 20.0,
  15.             fontWeight: FontWeight.bold,
  16.           ),
  17.         ),
  18.  
  19.         // Texto
  20.         textTheme: TextTheme(
  21.           headline6: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold),
  22.           bodyText1: TextStyle(fontSize: 16.0, color: Colors.grey[800]),
  23.         ),
  24.  
  25.         // Botões
  26.         elevatedButtonTheme: ElevatedButtonThemeData(
  27.           style: ElevatedButton.styleFrom(
  28.             primary: Colors.deepPurple,
  29.             onPrimary: Colors.white,  
  30.  
  31.             shape: RoundedRectangleBorder(
  32.               borderRadius: BorderRadius.circular(10.0),  
  33.  
  34.             ),
  35.           ),
  36.         ),
  37.  
  38.         // Input
  39.         inputDecorationTheme: InputDecorationTheme(
  40.           filled: true,
  41.           fillColor: Colors.grey[200],
  42.           contentPadding: EdgeInsets.symmetric(horizontal:  
  43.  20.0),
  44.           border: OutlineInputBorder(
  45.             borderRadius: BorderRadius.circular(10.0),
  46.             borderSide: BorderSide.none,
  47.           ),
  48.         ),
  49.  
  50.         // Fontes
  51.         fontFamily: 'Roboto',
  52.       )
  53.  
  54. /*
  55. Outros exemplos:
  56. cardTheme: Personaliza a aparência dos cards.
  57. iconTheme: Personaliza a aparência dos ícones.
  58. dividerTheme: Personaliza a aparência dos divisores.
  59. visualDensity: Ajusta a densidade visual dos elementos.
  60. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement