Skip to content

Commit

Permalink
feat: implement design system
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariane Leonard authored and Ariane Leonard committed Oct 7, 2024
1 parent 6eb8ce9 commit 412d3f0
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 14 deletions.
2 changes: 2 additions & 0 deletions doc/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ This applications uses [Flutter](https://flutter.dev/) as the UI framework.
### Design System

This application uses resources from Material Design.
The application's Theme Data is defined in the `global_theme_data` file in the `styles` folder.
Any other files related to the application's design system should be added to this folder.

### Localization

Expand Down
Binary file added src/app/assets/fonts/guillon_black.ttf
Binary file not shown.
Binary file added src/app/assets/fonts/guillon_bold.ttf
Binary file not shown.
Binary file added src/app/assets/fonts/guillon_light.ttf
Binary file not shown.
Binary file added src/app/assets/fonts/guillon_regular.ttf
Binary file not shown.
Binary file added src/app/assets/fonts/guillon_semibold.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions src/app/lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:app/app_router.dart';
import 'package:app/l10n/gen_l10n/app_localizations.dart';
import 'package:app/presentation/styles/global_theme_data.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

Expand All @@ -10,6 +11,8 @@ final class App extends StatelessWidget {
Widget build(BuildContext context) {
return ProviderScope(
child: MaterialApp.router(
theme: GlobalThemeData.lightThemeData,
darkTheme: GlobalThemeData.darkThemeData,
routerConfig: router,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
Expand Down
38 changes: 38 additions & 0 deletions src/app/lib/presentation/styles/global_theme_data.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'package:flutter/material.dart';

class GlobalThemeData {
static ThemeData lightThemeData = themeData(lightColorScheme);
static ThemeData darkThemeData = themeData(darkColorScheme);

static ThemeData themeData(ColorScheme colorScheme) {
return ThemeData(
useMaterial3: true,
fontFamily: 'Guillon',
colorScheme: colorScheme,
);
}

static const ColorScheme lightColorScheme = ColorScheme(
primary: Color(0xFF0D59CD),
onPrimary: Colors.white,
secondary: Color(0xFF5BC5F2),
onSecondary: Color(0xFF001E60),
error: Color(0xFFD93B27),
onError: Color(0xFFFDEFED),
surface: Color(0xFFF5FAFF),
onSurface: Color(0xFF001E60),
brightness: Brightness.light,
);

static const ColorScheme darkColorScheme = ColorScheme(
primary: Color(0xFF89C5FF),
onPrimary: Color(0xFF121821),
secondary: Color(0xFFFCA58B),
onSecondary: Color(0xFF302B29),
error: Color(0xFFE8897D),
onError: Color(0xFF32110D),
surface: Color(0xFF2C3034),
onSurface: Colors.white,
brightness: Brightness.dark,
);
}
28 changes: 14 additions & 14 deletions src/app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -536,18 +536,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -592,18 +592,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.15.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -776,10 +776,10 @@ packages:
dependency: transitive
description:
name: platform
sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
url: "https://pub.dev"
source: hosted
version: "3.1.4"
version: "3.1.5"
plugin_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -1077,10 +1077,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
version: "0.7.2"
timezone:
dependency: transitive
description:
Expand Down Expand Up @@ -1197,10 +1197,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
url: "https://pub.dev"
source: hosted
version: "14.2.1"
version: "14.2.4"
watcher:
dependency: transitive
description:
Expand Down
19 changes: 19 additions & 0 deletions src/app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ flutter:

assets:
- assets/openSourceSoftwareLicenses.json
- assets/fonts/guillon_black.ttf
- assets/fonts/guillon_bold.ttf
- assets/fonts/guillon_light.ttf
- assets/fonts/guillon_regular.ttf
- assets/fonts/guillon_semibold.ttf
- .env.dev
- .env.staging
- .env.prod

fonts:
- family: Guillon
fonts:
- asset: assets/fonts/guillon_light.ttf
weight: 300
- asset: assets/fonts/guillon_regular.ttf
weight: 400
- asset: assets/fonts/guillon_semibold.ttf
weight: 600
- asset: assets/fonts/guillon_bold.ttf
weight: 700
- asset: assets/fonts/guillon_black.ttf
weight: 900
1 change: 1 addition & 0 deletions src/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ Prefix your items with `(Template)` if the change is about the template and not
- Added localization.
- Added test for the killswitch.
- Added integration test for forced update.
- Added design system, including color scheme and fonts.

0 comments on commit 412d3f0

Please sign in to comment.