Skip to content

Commit

Permalink
feat: add flutter_gen
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardodalarme committed Oct 24, 2023
1 parent 366861b commit 0e55289
Show file tree
Hide file tree
Showing 11 changed files with 384 additions and 26 deletions.
6 changes: 5 additions & 1 deletion lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:nubank_clone/constants/fonts.gen.dart';
import 'package:nubank_clone/core/app_state.dart';
import 'package:nubank_clone/pages/home/home_screen.dart';
import 'package:nubank_clone/theme/texts.dart';
Expand All @@ -26,7 +27,10 @@ class App extends StatelessWidget {
child: MaterialApp(
title: 'Nubank Clone',
debugShowCheckedModeBanner: false,
theme: ThemeData(fontFamily: 'Gotham-SSm', textTheme: customTextTheme),
theme: ThemeData(
fontFamily: FontFamily.gothamSSm,
textTheme: customTextTheme,
),
home: HomeScreen(),
),
);
Expand Down
9 changes: 0 additions & 9 deletions lib/constants/app_images.dart

This file was deleted.

120 changes: 120 additions & 0 deletions lib/constants/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions lib/constants/fonts.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/constants/nu_icons.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// ignore_for_file: constant_identifier_names

import 'package:flutter/widgets.dart';
import 'package:nubank_clone/constants/fonts.gen.dart';

abstract class NuIcons {
static const _kFontFamily = 'NuIcons';
static const _kFontFamily = FontFamily.nuIcons;

static const IconData nuds_ic_category_store =
IconData(0xe800, fontFamily: _kFontFamily);
Expand Down
5 changes: 2 additions & 3 deletions lib/pages/easyinvest/easyinvest_screen.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:nubank_clone/constants/app_colors.dart';
import 'package:nubank_clone/constants/app_images.dart';
import 'package:nubank_clone/constants/assets.gen.dart';
import 'package:nubank_clone/constants/nu_icons.dart';
import 'package:nubank_clone/utils/extensions/router_context_extension.dart';

Expand Down Expand Up @@ -34,8 +34,7 @@ class EasyInvestScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
AppImages.easyinvest,
Assets.images.easyinvest.image(
height: 118,
),
const SizedBox(height: 47),
Expand Down
5 changes: 2 additions & 3 deletions lib/pages/pix/pix_screen.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:nubank_clone/constants/app_colors.dart';
import 'package:nubank_clone/constants/app_images.dart';
import 'package:nubank_clone/constants/assets.gen.dart';
import 'package:nubank_clone/constants/nu_icons.dart';
import 'package:nubank_clone/pages/pix/widgets/pix_menu.dart';
import 'package:nubank_clone/utils/extensions/router_context_extension.dart';
Expand Down Expand Up @@ -29,8 +29,7 @@ class PixScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
AppImages.pix,
Assets.images.pix.image(
height: 150,
),
const SizedBox(height: 30),
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/refer/refer_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:nubank_clone/constants/app_colors.dart';
import 'package:nubank_clone/constants/app_images.dart';
import 'package:nubank_clone/constants/assets.gen.dart';
import 'package:nubank_clone/constants/nu_icons.dart';
import 'package:nubank_clone/utils/extensions/router_context_extension.dart';
import 'package:nubank_clone/widgets/nu_outlined_button.dart';
Expand Down Expand Up @@ -37,7 +37,7 @@ class ReferScreen extends StatelessWidget {
),
const SizedBox(height: 20),
const NuOutlinedButton('Indicar amigos'),
Image.asset(AppImages.referFriend),
Assets.images.referFriend.image(),
],
),
),
Expand Down
11 changes: 4 additions & 7 deletions lib/pages/rewards/rewards_screen.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:nubank_clone/constants/app_colors.dart';
import 'package:nubank_clone/constants/app_images.dart';
import 'package:nubank_clone/constants/assets.gen.dart';
import 'package:nubank_clone/constants/nu_icons.dart';
import 'package:nubank_clone/utils/extensions/router_context_extension.dart';

Expand Down Expand Up @@ -45,8 +45,7 @@ class RewardsScreen extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
AppImages.easyinvest,
Assets.images.referFriend.image(
height: 118,
),
const SizedBox(height: 47),
Expand All @@ -68,8 +67,7 @@ class RewardsScreen extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
AppImages.easyinvest,
Assets.images.easyinvest.image(
height: 118,
),
const SizedBox(height: 47),
Expand All @@ -91,8 +89,7 @@ class RewardsScreen extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
AppImages.easyinvest,
Assets.images.easyinvest.image(
height: 118,
),
const SizedBox(height: 47),
Expand Down
Loading

0 comments on commit 0e55289

Please sign in to comment.