Skip to content

Commit

Permalink
break: remove KText widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Gambley1 committed May 21, 2024
1 parent 75c850d commit 2c0c089
Show file tree
Hide file tree
Showing 75 changed files with 1,394 additions and 770 deletions.
1 change: 1 addition & 0 deletions lib/bootstrap.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:async';

import 'package:app_ui/app_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:hive_flutter/hive_flutter.dart';
Expand Down
5 changes: 4 additions & 1 deletion lib/src/app/view/app_view.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:app_ui/app_ui.dart';
import 'package:flutter/material.dart';
import 'package:papa_burger/src/config/config.dart';

Expand All @@ -9,7 +10,9 @@ class AppView extends StatelessWidget {
return MaterialApp(
title: 'Papa Burger',
debugShowCheckedModeBanner: false,
theme: AppTheme.lightTheme,
themeMode: ThemeMode.light,
theme: const AppTheme().theme,
darkTheme: const AppDarkTheme().theme,
routes: Routes.routes,
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/src/config/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ export 'dotenv.dart';
export 'extensions/extensions.dart';
export 'logger.dart';
export 'routes/routes.dart';
export 'theme/app_theme.dart';
export 'utils/utils.dart';
2 changes: 0 additions & 2 deletions lib/src/config/extensions/extensions.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export 'build_context_extension.dart';
export 'connection_state_to_status.dart';
export 'ignore_pointer_extension.dart';
export 'navigator_extension.dart';
export 'show_bottom_modal_sheet_extension.dart';
export 'snack_bar_extension.dart';
export 'text_style_extension.dart';
export 'to_upper_case_extension.dart';
export 'trimmed_converted_string_contains_extension.dart';
39 changes: 16 additions & 23 deletions lib/src/config/extensions/show_bottom_modal_sheet_extension.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:app_ui/app_ui.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:papa_burger/src/config/config.dart';
Expand Down Expand Up @@ -51,10 +52,10 @@ extension BottomModalSheetExtension on BuildContext {
sliver: SliverToBoxAdapter(
child: Column(
children: [
KText(
text: item.description,
size: 18,
color: Colors.black.withOpacity(.7),
Text(
item.description,
style: context.bodyLarge
?.apply(color: AppColors.black.withOpacity(.7)),
),
],
),
Expand Down Expand Up @@ -134,7 +135,6 @@ class IncreaseDecreaseQuantityBottomAppBar extends StatelessWidget {

@override
Widget build(BuildContext context) {
logI('Build bottom app bar.');
return BottomAppBar(
child: Padding(
padding: const EdgeInsets.symmetric(
Expand All @@ -146,15 +146,9 @@ class IncreaseDecreaseQuantityBottomAppBar extends StatelessWidget {
children: [
Row(
children: [
KText(
text: item.name,
size: 20,
),
Text(item.name, style: context.titleLarge),
const Spacer(),
KText(
text: item.priceString,
size: 20,
),
Text(item.priceString, style: context.titleLarge),
],
),
const SizedBox(
Expand Down Expand Up @@ -190,9 +184,7 @@ class IncreaseDecreaseQuantityBottomAppBar extends StatelessWidget {
quantity.value = quantity.value - 1;
},
),
KText(
text: value.toString(),
),
Text(value.toString()),
CustomIcon(
icon: FontAwesomeIcons.plus,
type: IconType.iconButton,
Expand All @@ -218,14 +210,15 @@ class IncreaseDecreaseQuantityBottomAppBar extends StatelessWidget {
context.pop();
},
child: Ink(
decoration: BoxDecoration(
color: kPrimaryBackgroundColor,
decoration: const BoxDecoration(
color: AppColors.deepBlue,
),
child: const Align(
child: KText(
text: 'Add',
size: 22,
fontWeight: FontWeight.bold,
child: Align(
child: Text(
'Add',
style: context.titleLarge?.copyWith(
fontWeight: AppFontWeight.bold,
),
),
),
),
Expand Down
99 changes: 0 additions & 99 deletions lib/src/config/theme/app_theme.dart

This file was deleted.

5 changes: 0 additions & 5 deletions lib/src/config/utils/app_colors.dart

This file was deleted.

1 change: 1 addition & 0 deletions lib/src/config/utils/app_routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class HomePage extends StatelessWidget {
Widget build(BuildContext context) {
final user = LocalStorage().getUser;
final hasAddress = LocalStorage().hasAddress;
return const MainPage();
if (user == null) {
return const LoginView();
}
Expand Down
1 change: 0 additions & 1 deletion lib/src/config/utils/utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export 'app_colors.dart';
export 'app_constants.dart';
export 'app_page_storage_key.dart';
export 'app_routes.dart';
Expand Down
52 changes: 26 additions & 26 deletions lib/src/views/pages/cart/cart_view.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:app_ui/app_ui.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'
show FontAwesomeIcons;
Expand Down Expand Up @@ -64,30 +65,29 @@ class _CartViewState extends State<CartView> {
padding: const EdgeInsets.only(top: 240),
child: Column(
children: [
const KText(
text: 'Your Cart is Empty',
size: 26,
fontWeight: FontWeight.bold,
Text(
'Your Cart is Empty',
style: context.displaySmall,
),
OutlinedButton(
onPressed: () {
context.navigateToMainPage();
},
child: const Row(
onPressed: () => context.navigateToMainPage(),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
CustomIcon(
const CustomIcon(
icon: FontAwesomeIcons.cartShopping,
type: IconType.simpleIcon,
color: Colors.grey,
),
SizedBox(
const SizedBox(
width: 6,
),
KText(
text: 'Explore',
size: 22,
color: Colors.grey,
Text(
'Explore',
style: context.displaySmall?.copyWith(
fontWeight: AppFontWeight.regular,
color: AppColors.grey,
),
),
],
),
Expand Down Expand Up @@ -139,12 +139,12 @@ class _CartViewState extends State<CartView> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
KText(maxLines: 1, text: title),
KText(
Text(title, maxLines: 1),
Text(
subtitle,
maxLines: 1,
text: subtitle,
size: 14,
color: Colors.grey.shade500,
style: context.bodyMedium
?.apply(color: AppColors.grey.withOpacity(.5)),
),
const SizedBox(height: 12),
const Divider(
Expand Down Expand Up @@ -237,12 +237,13 @@ class _CartViewState extends State<CartView> {
return SliverToBoxAdapter(
child: ListTile(
onTap: () => showChoosePaymentModalBottomSheet(context),
title: KText(
text: noSelection
title: Text(
noSelection
? 'Choose credit card'
: 'VISA •• '
'${selectedCard.number.characters.getRange(15, 19)}',
color: noSelection ? Colors.red : Colors.black,
style: context.bodyMedium
?.apply(color: noSelection ? Colors.red : Colors.black),
),
trailing: const CustomIcon(
icon: Icons.arrow_forward_ios_sharp,
Expand Down Expand Up @@ -335,10 +336,9 @@ class CartAppBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SliverAppBar(
title: const KText(
text: 'Cart',
size: 26,
fontWeight: FontWeight.bold,
title: Text(
'Cart',
style: context.headlineMedium?.copyWith(fontWeight: AppFontWeight.bold),
),
leading: CustomIcon(
icon: FontAwesomeIcons.arrowLeft,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// ignore_for_file: parameter_assignments

import 'package:app_ui/app_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_credit_card/flutter_credit_card.dart';
import 'package:google_fonts/google_fonts.dart';
Expand Down Expand Up @@ -181,10 +182,10 @@ class _AddCreditCardModalBottomSheetState
vertical: kDefaultHorizontalPadding,
),
decoration: BoxDecoration(
color: kPrimaryBackgroundColor,
color: AppColors.indigo,
borderRadius: BorderRadius.circular(kDefaultBorderRadius),
),
child: const KText(text: 'Add', size: 19),
child: Text('Add', style: context.bodyLarge),
),
),
],
Expand Down
18 changes: 5 additions & 13 deletions lib/src/views/pages/cart/components/cart_bottom_app_bar.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:app_ui/app_ui.dart';
import 'package:flutter/material.dart';
import 'package:papa_burger/src/config/config.dart';
import 'package:papa_burger/src/models/models.dart';
import 'package:papa_burger/src/views/pages/cart/state/cart_bloc.dart';
import 'package:papa_burger/src/views/widgets/widgets.dart';

class CartBottomAppBar extends StatelessWidget {
const CartBottomAppBar({
Expand All @@ -23,13 +23,8 @@ class CartBottomAppBar extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
KText(
text: cart.totalSum(),
size: 28,
),
KText(
text: info,
),
Text(cart.totalSum(), style: context.headlineMedium),
Text(info),
],
),
const SizedBox(
Expand All @@ -45,13 +40,10 @@ class CartBottomAppBar extends StatelessWidget {
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(kDefaultBorderRadius),
color: kPrimaryBackgroundColor,
color: AppColors.indigo,
),
child: Align(
child: KText(
text: title,
size: 19,
),
child: Text(title, style: context.titleLarge),
),
),
),
Expand Down
Loading

0 comments on commit 2c0c089

Please sign in to comment.