Saturday, August 29, 2020

Custom Fonts | Icons | Google Fonts

.........................................................................................................................................................................................................................................
Example :#1 [Google Fonts]

Download links as below
https://fonts.google.com/

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

void main() {
  runApp(MyApp());
}
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Home(),
    );
  }
}
class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(  
        title: Text('FontAwesome'),
        centerTitle: true,
      ),
      body: Center(   
        child: Column(  
          children: [
            Text('Hello', style: TextStyle(fontFamily: 'Langar', fontSize: 30)),
            Text('Hello',style: TextStyle(fontFamily: 'Dancing', fontSize: 50)),
          ],
        ),
      ),
    );
  }
}

Happy Coding :)
.........................................................................................................................................................................................................................................
Example :#2 [ Google Fonts]

Library
https://pub.dev/packages/google_fonts/install
  google_fonts: ^1.1.1

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

void main() {
  runApp(MyApp());
}
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Home(),
    );
  }
}
class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(  
        title: Text('FontAwesome'),
        centerTitle: true,
      ),
      body: Center(   
        child: Column(  
          children: [
            Text('Gogole Fonts', style: GoogleFonts.pacifico()),
          ],
        ),
      ),
    );
  }
}
Happy Coding :)
.........................................................................................................................................................................................................................................
Example :#3 [ FontAwesome flutter Icon]

Library
https://pub.dev/packages/font_awesome_flutter/install
  font_awesome_flutter: ^8.10.1

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

void main() {
  runApp(MyApp());
}
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Home(),
    );
  }
}
class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(  
        title: Text('FontAwesome'),
        centerTitle: true,
      ),
      body: Center(   
        child: Column(  
          children: [
            Icon(FontAwesomeIcons.android, size: 50),
            Icon(FontAwesomeIcons.addressBook, size: 50),
            Icon(FontAwesomeIcons.airFreshener, size: 50),
            Icon(FontAwesomeIcons.appStoreIos, size: 50),
            Icon(FontAwesomeIcons.bookMedical, size: 50)
          ],
        ),
      ),
    );
  }
}

Happy Coding :)
.........................................................................................................................................................................................................................................
Example :#4 []



Happy Coding :)
.........................................................................................................................................................................................................................................
Example :#5 []



Happy Coding :)
.........................................................................................................................................................................................................................................
Example :#6 []




Happy Coding :)
.........................................................................................................................................................................................................................................
Example :#7 []

Happy Coding :)

No comments:

Post a Comment