Skip to content

Commit

Permalink
refactor: design system (#31)
Browse files Browse the repository at this point in the history
* refactor: design system

* ci: adjust setup

* fix: design links

* fix: `Badge` and `AppBar`

* chore: add macos

* refactor: improve challenge (#2)

* refactor: design system and app

* feat: add language for NavigationBar

* refactor: `designLink`s

* refactor: renamed components

* refactor: exchange icons

* fix: added padding

* fix: icon dark mode color

* ci: update widgetbook CLI

* ci: update codemagic setup

* ci: create Build on push

* ci: fix azure

* fix: button to full round

---------

Co-authored-by: Youssef Raafat <[email protected]>
  • Loading branch information
jenshor and yousinix authored Aug 27, 2024
1 parent 5f1d771 commit 4328bea
Show file tree
Hide file tree
Showing 139 changed files with 3,423 additions and 1,838 deletions.
2 changes: 1 addition & 1 deletion .azure/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ stages:
workingDirectory: 'widgetbook'
targetType: 'inline'
script: |
$HOME/.pub-cache/bin/widgetbook publish \
$HOME/.pub-cache/bin/widgetbook cloud build push \
--api-key 7396fbb0851ab29f0cc78246355b786de54a087dba3828acde90ac7afef7d97f \
--branch '$(Build.SourceBranch)' \
--repository '$(Build.DefinitionName)' \
Expand Down
42 changes: 2 additions & 40 deletions codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ workflows:
triggering:
events:
- push
branch_patterns:
- pattern: main
include: true

environment:
flutter: stable
Expand All @@ -33,41 +30,6 @@ workflows:
- name: Upload Widgetbook
working_directory: widgetbook
script: |
widgetbook publish \
widgetbook cloud build push \
--api-key $WIDGETBOOK_API_KEY \
--branch $CM_BRANCH
widgetbook-review:
name: Upload Widgetbook Review

triggering:
events:
- pull_request

environment:
flutter: stable
groups:
- Widgetbook Credentials

scripts:
- name: Build App
script: |
flutter pub get
flutter gen-l10n
- name: Install Widgetbook CLI
script: dart pub global activate widgetbook_cli

- name: Build Widgetbook
working_directory: widgetbook
script: |
flutter pub get
dart run build_runner build -d
flutter build web -t lib/main.dart
- name: Upload Widgetbook
working_directory: widgetbook
script: |
widgetbook publish \
--api-key $WIDGETBOOK_API_KEY \
--base-branch source/$CM_PULL_REQUEST_DEST
--branch $CM_BRANCH
6 changes: 3 additions & 3 deletions lib/about/about_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';

import '../theme/app_theme.dart';
import '../ui/ui.dart';

class AboutScreen extends StatelessWidget {
const AboutScreen({super.key});
Expand All @@ -18,11 +18,11 @@ class AboutScreen extends StatelessWidget {
height: 100,
),
SizedBox(
height: AppTheme.of(context).spacing.medium,
height: AppTheme.of(context).spacing.m,
),
Text(
'Created by Widgetbook',
style: AppTheme.of(context).typography.labelMedium14,
style: AppTheme.of(context).typography.label,
),
],
),
Expand Down
29 changes: 7 additions & 22 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,12 @@ import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart';

import 'about/about_screen.dart';
import 'basket/basket.dart';
import 'home/home.dart';
import 'features/basket/basket.dart';
import 'l10n/app_localizations.dart';
import 'repositories/fruits_repository.dart';
import 'theme/theme.dart';
import 'ui/ui.dart';

final _router = GoRouter(
routes: [
GoRoute(
path: '/',
builder: (_, __) => FutureBuilder(
future: FruitRepository().getFruits(),
builder: (_, snapshot) {
if (!snapshot.hasData) return const Placeholder();

return HomeScreen(
fruits: snapshot.data!,
);
},
),
),
GoRoute(
path: '/about',
builder: (context, state) => const AboutScreen(),
Expand All @@ -33,7 +18,7 @@ final _router = GoRouter(
builder: (context, state) {
final basketState = BasketState.of(context);

return BasketScreen(
return BasketView(
basket: basketState.store,
delivery: basketState.delivery,
subTotal: basketState.subTotal,
Expand All @@ -50,18 +35,18 @@ class App extends StatelessWidget {
Widget build(BuildContext context) {
return AppTheme(
data: MediaQuery.of(context).platformBrightness == Brightness.light
? lightTheme
: darkTheme,
? AppThemeData.light
: AppThemeData.dark,
child: Builder(
builder: (context) {
return BasketScope(
child: ColoredBox(
color: AppTheme.of(context).surface.primary,
color: AppTheme.of(context).background.primary,
child: SafeArea(
child: WidgetsApp.router(
title: 'Grocery App',
debugShowCheckedModeBanner: false,
color: lightTheme.surface.primary,
color: AppTheme.of(context).background.primary,
routerConfig: _router,
supportedLocales: AppLocalizations.supportedLocales,
localizationsDelegates:
Expand Down
4 changes: 0 additions & 4 deletions lib/basket/basket.dart

This file was deleted.

123 changes: 0 additions & 123 deletions lib/basket/basket_screen.dart

This file was deleted.

103 changes: 0 additions & 103 deletions lib/basket/widgets/basket_card.dart

This file was deleted.

Loading

0 comments on commit 4328bea

Please sign in to comment.