Skip to content

Commit 26bdda7

Browse files
Tomasz KądziołkaTomasz Kądziołka
authored andcommitted
Added logo image and text
1 parent 9c84306 commit 26bdda7

File tree

6 files changed

+45
-16
lines changed

6 files changed

+45
-16
lines changed
Loading
166 KB
Binary file not shown.

flutter_module/lib/generated/assets.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
class Assets {
33
Assets._();
44

5+
static const String appLogo = 'assets/images/illustrations/app_logo.png';
56
static const String reactionDislike = 'assets/images/icons/reaction_dislike.png';
67
static const String reactionLike = 'assets/images/icons/reaction_like.png';
78
static const String reactionUndefined = 'assets/images/icons/reaction_undefined.png';

flutter_module/lib/presentation/screens/login_screen.dart

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_hooks/flutter_hooks.dart';
3+
import 'package:flutter_module/generated/assets.dart';
34
import 'package:flutter_module/presentation/navigation/login/login_navigator.dart';
45
import 'package:flutter_module/presentation/screens/named_screen.dart';
6+
import 'package:flutter_module/presentation/styles/dimens.dart';
57
import 'package:flutter_module/presentation/styles/padding_styles.dart';
8+
import 'package:flutter_module/presentation/styles/text_styles.dart';
69
import 'package:flutter_module/presentation/widgets/login_input_card.dart';
710
import 'package:flutter_module/utils/hooks/use_navigator.dart';
811
import 'package:go_router/go_router.dart';
@@ -33,23 +36,30 @@ class _MainPage extends HookWidget {
3336
final password = useState("");
3437

3538
return Scaffold(
36-
body: Center(
37-
child: Column(
38-
mainAxisAlignment: MainAxisAlignment.center,
39-
children: [
40-
// TODO Extract strings
41-
Text(LoginScreen.name),
42-
PaddingStyles.regular(
43-
LoginInputCard(
44-
onLoginChanged: (value) => login.value = value,
45-
onPasswordChanged: (value) => password.value = value,
39+
body: SingleChildScrollView(
40+
child: Center(
41+
child: Column(
42+
mainAxisAlignment: MainAxisAlignment.center,
43+
children: [
44+
const SizedBox(height: Dimens.xxl),
45+
TextStyles.appLogo('SnipMe'),
46+
const SizedBox(height: Dimens.xxl),
47+
Image.asset(Assets.appLogo),
48+
const SizedBox(height: Dimens.xxl),
49+
const TextStyles.secondary('Snip your favorite code'),
50+
PaddingStyles.regular(
51+
LoginInputCard(
52+
onLoginChanged: (value) => login.value = value,
53+
onPasswordChanged: (value) => password.value = value,
54+
),
4655
),
47-
),
48-
MaterialButton(
49-
child: const Text("Navigate to login"),
50-
onPressed: navigator.login,
51-
),
52-
],
56+
MaterialButton(
57+
onPressed: navigator.login,
58+
child: const Text("Navigate to login"),
59+
),
60+
const SizedBox(height: Dimens.xxl),
61+
],
62+
),
5363
),
5464
),
5565
);

flutter_module/lib/presentation/styles/text_styles.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter_module/presentation/styles/color_styles.dart';
23

34
class TextStyles extends Text {
45
final String text;
@@ -57,4 +58,15 @@ class TextStyles extends Text {
5758
key: key,
5859
style: const TextStyle(fontSize: 10, color: Colors.grey),
5960
);
61+
62+
TextStyles.appLogo(this.text, {Key? key})
63+
: super(
64+
text,
65+
key: key,
66+
style: TextStyle(
67+
fontFamily: 'Kanit',
68+
fontSize: 24,
69+
color: ColorStyles.accent(),
70+
),
71+
);
6072
}

flutter_module/pubspec.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,15 @@ flutter:
5555
# the material Icons class.
5656
uses-material-design: true
5757
assets:
58+
- assets/images/illustrations/app_logo.png
5859
- assets/images/icons/reaction_undefined.png
5960
- assets/images/icons/reaction_like.png
6061
- assets/images/icons/reaction_dislike.png
62+
fonts:
63+
- family: Kanit
64+
fonts:
65+
- asset: fonts/Kanit-Regular.ttf
66+
6167

6268
# An image asset can refer to one or more resolution-specific "variants", see
6369
# https://flutter.dev/assets-and-images/#resolution-aware.

0 commit comments

Comments
 (0)