Repositório GitHubjohandb/flutter_titled_container

flutter_titled_container

johandb/flutter_titled_container open-source repository details.

Capa do projeto flutter_titled_container
Estrelas
3
Forks
1
Último push (UTC)
28 de mai. de 2021
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

flutter_titled_container

Display a title on top of the Container.

The widget works best with a child container : Container

You can set the following properties :

  • title - The text to display
  • titleColor - The color (foreground) fors title, default is black
  • fontSize - The font size for title, default is 14.0
  • backgroundColor - The background color for title, default is white
  • textAlign - The alignment for text. i.e. Lef, Center or Right

See the screenshot

Example

import 'package:flutter/material.dart';
import 'package:flutter_titled_container/flutter_titled_container.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        centerTitle: true,
        title: Text('Titled Container'),
      ),
      body: Center(
        child: TitledContainer(
          titleColor: Colors.blue,
          title: 'Container Title',
          textAlign: TextAlignTitledContainer.Center,
          fontSize: 16.0,
          backgroundColor: Colors.white,
          child: Container(
            width: 250.0,
            height: 200.0,
            decoration: BoxDecoration(
              border: Border.all(
                color: Colors.blue,
              ),
              borderRadius: BorderRadius.all(
                Radius.circular(10.0),
              ),
            ),
            child: Center(
              child: Text(
                'Some text',
                style: TextStyle(fontSize: 28.0),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Johan den Boer GitHub avatar
Autor no GitHub

Johan den Boer ↗

I am a Java, IOS developer and Ethic Hacker. I develop in Java, IOS, Flutter, React, Angular, Tailwind, Bootstrap. Like to learn new technologies.

LinguagensDartSwiftKotlinObjective-C

Categorias

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 2 itens

  • flutter{"sdk":"flutter"}
  • flutter_testDesenvolvimento{"sdk":"flutter"}

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗