Skip to content

Commit

Permalink
feat: set poppins font family (#357)
Browse files Browse the repository at this point in the history
* fix: use google_fonts package

* chore: remove unused import
  • Loading branch information
juaoose authored Apr 25, 2022
1 parent b8e91a0 commit 47d7d6f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/components/style_model_theme.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:rtchat/models/style.dart';
Expand All @@ -12,11 +14,12 @@ class StyleModelTheme extends StatelessWidget {
return Consumer<StyleModel>(
builder: (context, model, child) {
final theme = Theme.of(context);
final fontFamily = Platform.isIOS
? Typography.whiteCupertino.bodyText2!.fontFamily
: Typography.whiteMountainView.bodyText2!.fontFamily;
final themeData = theme.copyWith(
textTheme:
theme.textTheme.apply(fontSizeDelta: model.fontSize - 14),
);

textTheme: theme.textTheme.apply(
fontSizeDelta: model.fontSize - 14, fontFamily: fontFamily));
return Theme(
data: themeData,
child: DefaultTextStyle(
Expand Down
7 changes: 7 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'package:rtchat/models/activity_feed.dart';
import 'package:rtchat/models/audio.dart';
Expand Down Expand Up @@ -271,10 +272,16 @@ class _AppState extends State<App> {
child: MaterialApp(
title: 'RealtimeChat',
theme: ThemeData(
textTheme: GoogleFonts.poppinsTextTheme(
Theme.of(context).textTheme,
),
brightness: Brightness.light,
primarySwatch: primarySwatch,
),
darkTheme: ThemeData(
textTheme: GoogleFonts.poppinsTextTheme(
Theme.of(context).textTheme,
),
brightness: Brightness.dark,
primarySwatch: primarySwatch,
scaffoldBackgroundColor: Colors.black,
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.1"
html:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies:
firebase_remote_config: ^2.0.0
flutter_keyboard_visibility: ^5.0.3
characters: ^1.2.0
google_fonts: ^2.3.1
mobile_scanner: ^1.0.0
motion_sensors: ^0.1.0

Expand Down

0 comments on commit 47d7d6f

Please sign in to comment.