1

No consigo que se cambie la fuente en mi text, esto es lo que tengo en mi pubspec.yaml:

name: selectable_navigation_drawer_example
version: 1.0.0+1

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.2

  provider: ^5.0.0

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: 

flutter_icons:
  android: 'launcher_icon'
  ios: true
  image_path: 'assets/icon/pibedslogopng.png'
  adaptive_icon_background: 'assets/icon/pibedslogopng.png'

flutter:
  uses-material-design: true
  assets:
    - assets/
  
  fonts:
    - family: AndadaPro
      fonts: 
        - asset: assets/fonts/AndadaPro-VariableFont_wght.ttf
  
    - family: Cursiva
      fonts: 
        - asset: assets/fonts/Cursiva.ttf

Vi videos de como agregarlo y creo que todo lo estoy haciendo bien. Esta es la parte del codigo en la que quiero agregar el font:

import 'package:flutter/material.dart';
import 'package:selectable_navigation_drawer_example/model/cantoscglist.dart';

class DetailsCG extends StatelessWidget {
  final LetraCG letraCG;

  DetailsCG(this.letraCG);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Color.fromRGBO(50, 55, 205, 1),
        title: Text(letraCG.titleCG),
        centerTitle: true,
      ),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: SingleChildScrollView(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Padding(
                padding: const EdgeInsets.all(8.0),
              ),
              Padding(
                padding: const EdgeInsets.all(8.0),
                child: Text(
                  letraCG.letraCG,
                  textAlign: TextAlign.center,

Aqui es donde no consigo que se refleje en el texto:

                  style: TextStyle(
                    fontFamily: 'Cursiva',
                    fontSize: 22.0,
                  ), 
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

La que quiero agregar en la parte de arriba es la cursiva, y esta no se refleja en el texto de la app.

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.