Skip to content

Commit

Permalink
Fonts fixs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandrakant0110 committed Feb 17, 2024
1 parent 69d1219 commit d6d64bd
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 7 deletions.
Binary file removed assets/fonts/Helvetica-Bold.ttf
Binary file not shown.
Binary file removed assets/fonts/Helvetica-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/HelveticaNeue.ttf
Binary file not shown.
Binary file added assets/fonts/HelveticaNeue400.ttf
Binary file not shown.
Binary file added assets/fonts/HelveticaNeue500.ttf
Binary file not shown.
Binary file added assets/fonts/HelveticaNeue600.ttf
Binary file not shown.
Binary file added assets/fonts/HelveticaNeue700.ttf
Binary file not shown.
Binary file added assets/fonts/HelveticaNeue800.ttf
Binary file not shown.
Binary file added assets/fonts/HelveticaNeue900.ttf
Binary file not shown.
Binary file added assets/fonts/HelveticaNeueIt.ttf
Binary file not shown.
Binary file added assets/fonts/icons.ttf
Binary file not shown.
16 changes: 15 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:twitter_clone/common/common.dart';
import 'package:twitter_clone/features/auth/controller/auth_controller.dart';
import 'package:twitter_clone/features/auth/view/landing_view.dart';
import 'package:twitter_clone/features/home/view/home_view.dart';
import 'package:twitter_clone/theme/app_theme.dart';
import 'package:twitter_clone/theme/pallete.dart';

void main() {
runApp(const ProviderScope(child: MyApp()));
Expand All @@ -18,7 +20,19 @@ class MyApp extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
return MaterialApp(
title: 'Twitter',
theme: AppTheme.theme,
theme: AppTheme.theme.copyWith(
textTheme: GoogleFonts.mulishTextTheme(
Theme.of(context).textTheme.copyWith(
// Set the default text color to white
bodyText1: Theme.of(context).textTheme.bodyText1!.copyWith(
color: Colors.white,
),
bodyText2: Theme.of(context).textTheme.bodyText2!.copyWith(
color: Colors.white,
),
),
),
),
debugShowCheckedModeBanner: false,

home: ref.watch(currentUserAccountProvider).when(
Expand Down
6 changes: 3 additions & 3 deletions lib/theme/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import 'package:twitter_clone/theme/pallete.dart';
class AppTheme {
static ThemeData theme = ThemeData.dark(useMaterial3: true).copyWith(
scaffoldBackgroundColor: Pallete.backgroundColor,
// textTheme: ThemeData.dark().textTheme.apply(
// fontFamily: 'Helvetica',
// ),
// textTheme: GoogleFonts.mulishTextTheme(
// Theme.of(context).textTheme,
// ),
appBarTheme: const AppBarTheme(
backgroundColor: Pallete.backgroundColor,
elevation: 0,
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
sha256: f0b8d115a13ecf827013ec9fc883390ccc0e87a96ed5347a3114cac177ef18e8
url: "https://pub.dev"
source: hosted
version: "6.1.0"
html:
dependency: transitive
description:
Expand Down
19 changes: 16 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies:
flutter_svg: ^2.0.9
fluttertoast: ^8.2.4
fpdart: ^1.1.0
google_fonts: ^6.1.0
image_picker: ^1.0.7
like_button: ^2.0.5
mime: ^1.0.5
Expand Down Expand Up @@ -72,11 +73,23 @@ flutter:
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: Helvetica
- family: HelveticaNeue
fonts:
- asset: assets/fonts/Helvetica-Medium.ttf
- asset: assets/fonts/Helvetica-Medium.ttf
- asset: assets/fonts/HelveticaNeue.ttf
- asset: assets/fonts/HelveticaNeue400.ttf
weight: 400
- asset: assets/fonts/HelveticaNeue500.ttf
weight: 500
- asset: assets/fonts/HelveticaNeue600.ttf
weight: 600
- asset: assets/fonts/HelveticaNeue700.ttf
weight: 700
- asset: assets/fonts/HelveticaNeue800.ttf
weight: 800
- asset: assets/fonts/HelveticaNeue900.ttf
weight: 900
- asset: assets/fonts/HelveticaNeueIt.ttf
style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
Expand Down

0 comments on commit d6d64bd

Please sign in to comment.