wemersonrv

Teste de tema

Dec 3rd, 2019
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 2.70 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:sca/app/shared/layout/layout.dart';
  3. import 'package:sca/app/shared/widgets/avatar.dart';
  4.  
  5. class ColorBasePage extends StatefulWidget {
  6.   final String title;
  7.  
  8.   const ColorBasePage({Key key, this.title}) : super(key: key);
  9.  
  10.   @override
  11.   _ColorBasePageState createState() => _ColorBasePageState();
  12. }
  13.  
  14. class _ColorBasePageState extends State<ColorBasePage> {
  15.   Widget content(BuildContext context) => Center(
  16.         child: SingleChildScrollView(
  17.           child: Column(
  18.             mainAxisAlignment: MainAxisAlignment.center,
  19.             children: <Widget>[
  20.               SizedBox(height: 10),
  21.               Text(
  22.                 'Página padrão',
  23.                 style: Theme.of(context).textTheme.title,
  24.               ),
  25.               Text(
  26.                 'Teste de estilos',
  27.                 style: TextStyle(
  28.                   color: Layout.info(),
  29.                   fontWeight: FontWeight.bold,
  30.                   fontSize: 16,
  31.                 ),
  32.               ),
  33.               SizedBox(height: 30),
  34.               Text(
  35.                 'Headline',
  36.                 style: Theme.of(context).textTheme.headline,
  37.               ),
  38.               Text(
  39.                 'Title',
  40.                 style: Theme.of(context).textTheme.title,
  41.               ),
  42.               Text(
  43.                 'Body 1',
  44.                 style: Theme.of(context).textTheme.body1,
  45.               ),
  46.               Text('Texto padrão'),
  47.               Text('Light color', style: TextStyle(color: Layout.light())),
  48.               Text('Medium color', style: TextStyle(color: Layout.medium())),
  49.               Text('Dark color', style: TextStyle(color: Layout.dark())),
  50.               Text('Danger color', style: TextStyle(color: Layout.danger())),
  51.               Text('Success color', style: TextStyle(color: Layout.success())),
  52.               Text('Info color', style: TextStyle(color: Layout.info())),
  53.               Text('Warning color', style: TextStyle(color: Layout.warning())),
  54.               SizedBox(height: 10),
  55.               Avatar(
  56.                 name: "Beatriz Vitória",
  57.                 image: "assets/tmp/usuario.jpg",
  58.                 borderTickness: 1,
  59.                 borderColor: Layout.light(),
  60.               ),
  61.               SizedBox(height: 20),
  62.             ],
  63.           ),
  64.         ),
  65.       );
  66.  
  67.   @override
  68.   Widget build(BuildContext context) {
  69.     return Layout.render(
  70.       title: widget.title,
  71.       content: content(context),
  72.       floatingActionButton: FloatingActionButton(
  73.         onPressed: () {},
  74.         tooltip: 'TODO: Automatizar Floating', // TODO: Automatizar Floating
  75.         child: Icon(Icons.add),
  76.       ),
  77.     );
  78.   }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment