Skip to content

Commit

Permalink
feat: Change icons source
Browse files Browse the repository at this point in the history
  • Loading branch information
deandreamatias committed Dec 25, 2020
1 parent 4c6f754 commit 0365ccb
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 47 deletions.
Binary file added assets/fonts/custom_icons.ttf
Binary file not shown.
Binary file removed assets/fonts/unicons.ttf
Binary file not shown.
12 changes: 12 additions & 0 deletions lib/ui/shared/custom_icons.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// Flutter icons Unicons
/// Copyright (C) 2020 by original authors @ fluttericon.com, fontello.com
/// This font was generated by FlutterIcon.com, which is derived from Fontello.
import 'package:flutter/widgets.dart';

class CustomIcons {
CustomIcons._();

static const String _kFontFam = 'CustomIcons';

static const IconData dice_multiple = IconData(0xe800, fontFamily: _kFontFam);
}
26 changes: 0 additions & 26 deletions lib/ui/shared/unicons_icons.dart

This file was deleted.

39 changes: 39 additions & 0 deletions lib/ui/views/privacy_policy_view.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:tv_randshow/core/utils/constants.dart';
import 'package:flutter/services.dart' show rootBundle;
import 'package:url_launcher/url_launcher.dart';

class PrivacyPolicyView extends StatelessWidget {
const PrivacyPolicyView({Key key}) : super(key: key);

@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: EdgeInsets.all(16.0),
key: const Key('app.privacy.scroll'),
physics: const BouncingScrollPhysics(),
child: FutureBuilder<String>(
future: rootBundle.loadString(Assets.PRIVACY_POLICY),
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
return snapshot.hasData
? MarkdownBody(
data: snapshot.data,
onTapLink: (text, href, title) async {
try {
await launch(href);
log('Launched: $href');
} catch (e) {
throw 'Could not launch $href because $e';
}
},
selectable: true,
)
: const Center(child: CircularProgressIndicator());
},
),
);
}
}
6 changes: 3 additions & 3 deletions lib/ui/views/result_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter_translate/flutter_translate.dart';

import '../../core/models/tvshow_result.dart';
import '../../core/utils/constants.dart';
import '../shared/unicons_icons.dart';
import '../shared/custom_icons.dart';
import '../widgets/home_button.dart';
import '../widgets/info_box.dart';
import 'loading_view.dart';
Expand Down Expand Up @@ -34,7 +34,7 @@ class ResultView extends StatelessWidget {
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 500),
child: Stack(
overflow: Overflow.visible,
clipBehavior: Clip.none,
alignment: Alignment.center,
children: <Widget>[
Positioned(
Expand Down Expand Up @@ -97,7 +97,7 @@ class ResultView extends StatelessWidget {
Align(
alignment: Alignment.bottomCenter,
child: RaisedButton.icon(
icon: const Icon(Unicons.dice_multiple),
icon: const Icon(CustomIcons.dice_multiple),
label: Text(
translate('app.result.button_random'),
key: const Key('app.result.button_random'),
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/views/search_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_pagewise/flutter_pagewise.dart';
import 'package:flutter_translate/flutter_translate.dart';
import 'package:stacked/stacked.dart';
import 'package:unicons/unicons.dart';

import '../../core/models/result.dart';
import '../../core/viewmodels/views/search_view_model.dart';
import '../shared/unicons_icons.dart';
import '../widgets/search_widget.dart';

class SearchView extends StatefulWidget {
Expand Down Expand Up @@ -74,7 +74,7 @@ class _SearchViewState extends State<SearchView> {
keyboardType: TextInputType.text,
decoration: InputDecoration(
hintText: translate('app.search.search_bar'),
prefixIcon: const Icon(Unicons.search),
prefixIcon: const Icon(UniconsLine.search),
),
),
),
Expand Down
14 changes: 7 additions & 7 deletions lib/ui/views/tab_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_translate/flutter_translate.dart';
import 'package:unicons/unicons.dart';

import '../shared/unicons_icons.dart';
import 'home_view.dart';
import 'info_view.dart';
import 'search_view.dart';
Expand Down Expand Up @@ -52,15 +52,15 @@ class _TabViewState extends State<TabView> {
destinations: <NavigationRailDestination>[
if (!kIsWeb)
NavigationRailDestination(
icon: const Icon(Unicons.favorite),
icon: const Icon(UniconsLine.favorite),
label: Text(translate('app.fav.tab')),
),
NavigationRailDestination(
icon: const Icon(Unicons.search),
icon: const Icon(UniconsLine.search),
label: Text(translate('app.search.tab')),
),
NavigationRailDestination(
icon: const Icon(Unicons.info_circle),
icon: const Icon(UniconsLine.info_circle),
label: Text(translate('app.info.tab')),
)
],
Expand Down Expand Up @@ -88,21 +88,21 @@ class _TabViewState extends State<TabView> {
if (!kIsWeb)
BottomNavigationBarItem(
icon: const Icon(
Unicons.favorite,
UniconsLine.favorite,
key: const Key('app.fav.tab'),
),
label: translate('app.fav.tab'),
),
BottomNavigationBarItem(
icon: const Icon(
Unicons.search,
UniconsLine.search,
key: const Key('app.search.tab'),
),
label: translate('app.search.tab'),
),
BottomNavigationBarItem(
icon: const Icon(
Unicons.info_circle,
UniconsLine.info_circle,
key: const Key('app.info.tab'),
),
label: translate('app.info.tab'),
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/widgets/delete_button.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_translate/flutter_translate.dart';
import 'package:stacked/stacked.dart';
import 'package:unicons/unicons.dart';

import '../../core/viewmodels/widgets/delete_model.dart';
import '../shared/unicons_icons.dart';

class DeleteButton extends StatelessWidget {
const DeleteButton({
Expand Down Expand Up @@ -32,7 +32,7 @@ class DeleteButton extends StatelessWidget {
border: Border.all(color: Theme.of(context).colorScheme.primary),
),
child: Icon(
Unicons.times,
UniconsLine.times,
size: 16.0,
color: Theme.of(context).accentColor,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/widgets/home_button.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_translate/flutter_translate.dart';
import 'package:unicons/unicons.dart';

import '../../core/utils/constants.dart';
import '../shared/unicons_icons.dart';
import '../views/tab_view.dart';

class HomeButton extends StatelessWidget {
Expand All @@ -24,7 +24,7 @@ class HomeButton extends StatelessWidget {
kIsWeb ? 'app.loading.button_search' : 'app.loading.button_fav',
),
),
icon: const Icon(kIsWeb ? Unicons.search : Unicons.favorite),
icon: const Icon(kIsWeb ? UniconsLine.search : UniconsLine.favorite),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/widgets/random_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:stacked/stacked.dart';
import '../../core/models/tvshow_details.dart';
import '../../core/utils/constants.dart';
import '../../core/viewmodels/widgets/random_model.dart';
import '../shared/unicons_icons.dart';
import '../shared/custom_icons.dart';
import '../views/loading_view.dart';

class RandomButton extends StatelessWidget {
Expand All @@ -19,7 +19,7 @@ class RandomButton extends StatelessWidget {
viewModelBuilder: () => RandomModel(),
builder: (BuildContext context, RandomModel model, Widget child) =>
RaisedButton.icon(
icon: const Icon(Unicons.dice_multiple),
icon: const Icon(CustomIcons.dice_multiple),
label: Text(
translate('app.fav.button_random'),
key: Key('app.fav.button_random.${tvshowDetails?.id ?? id}'),
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/widgets/save_button.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_translate/flutter_translate.dart';
import 'package:stacked/stacked.dart';
import 'package:unicons/unicons.dart';

import '../../core/viewmodels/widgets/save_model.dart';
import '../shared/unicons_icons.dart';

class SaveButton extends StatelessWidget {
const SaveButton({Key key, this.id}) : super(key: key);
Expand All @@ -19,7 +19,7 @@ class SaveButton extends StatelessWidget {
child: model.tvshowInDb
? RaisedButton.icon(
key: const ValueKey<String>('delete'),
icon: const Icon(Unicons.times),
icon: const Icon(UniconsLine.times),
label: Text(
translate('app.search.button_delete'),
key: Key('app.search.button_delete.$id'),
Expand All @@ -28,7 +28,7 @@ class SaveButton extends StatelessWidget {
)
: RaisedButton.icon(
key: const ValueKey<String>('add'),
icon: const Icon(Unicons.favorite),
icon: const Icon(UniconsLine.favorite),
label: Text(
translate('app.search.button_fav'),
key: Key('app.search.button_fav.$id'),
Expand Down

0 comments on commit 0365ccb

Please sign in to comment.