Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ app.*.symbols
/lib/main.config.dart
*.freezed.dart
*.g.dart
*/di.config.dart
*.config.dart
*.mocks.dart
lib/core/di/di.config.dart
*.gr.dart

2 changes: 1 addition & 1 deletion ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>12.0</string>
<string>13.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'
# platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/sqflite_darwin/darwin"

SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d

PODFILE CHECKSUM: 4305caec6b40dde0ae97be1573c53de1882a07e5
PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e

COCOAPODS: 1.15.2
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -585,7 +585,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -636,7 +636,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
3 changes: 3 additions & 0 deletions lib/core/designsystem/atoms/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ const primary = Color(0xFF1338BE);
const disabled = Color(0xFF565656);
const onBorder = Color(0xFF0D5EAF);
const onBackground = Color(0xFFC6E0FA);
const background = Color(0xFF3D67FF);
const error = Color.fromARGB(255, 196, 8, 8);
const primaryText = Color(0xFF110000);
3 changes: 3 additions & 0 deletions lib/core/designsystem/molecules/buttons/primary_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import 'package:mibook/core/designsystem/atoms/colors.dart';
class PrimaryButton extends StatelessWidget {
final String title;
final bool isEnabled;
final bool isExpanded;
final bool isLoading;
final VoidCallback onPressed;

const PrimaryButton({
super.key,
required this.title,
this.isEnabled = true,
this.isExpanded = false,
this.isLoading = false,
required this.onPressed,
});
Expand All @@ -19,6 +21,7 @@ class PrimaryButton extends StatelessWidget {
Widget build(BuildContext context) {
return SizedBox(
height: 48,
width: isExpanded ? double.infinity : null,
child: ElevatedButton(
onPressed: isEnabled ? onPressed : null,
style: ElevatedButton.styleFrom(
Expand Down
58 changes: 58 additions & 0 deletions lib/core/designsystem/molecules/buttons/secondary_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import 'package:flutter/material.dart';
import 'package:mibook/core/designsystem/atoms/colors.dart';

class SecondaryButton extends StatelessWidget {
final String title;
final bool isEnabled;
final bool isExpanded;
final bool isLoading;
final VoidCallback onPressed;

const SecondaryButton({
super.key,
required this.title,
this.isEnabled = true,
this.isExpanded = false,
this.isLoading = false,
required this.onPressed,
});

@override
Widget build(BuildContext context) {
return SizedBox(
height: 48,
width: isExpanded ? double.infinity : null,
child: OutlinedButton(
onPressed: isEnabled ? onPressed : null,
style: OutlinedButton.styleFrom(
side: BorderSide(
color: isEnabled ? primary : disabled,
width: 1.0,
),
foregroundColor: isEnabled ? primary : disabled,
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 12,
),
textStyle: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
minimumSize: const Size(80, 48),
),
child: isLoading
? SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(
color: Colors.white,
),
)
: Text(title),
),
);
}
}
25 changes: 25 additions & 0 deletions lib/core/designsystem/molecules/indicators/progress_stepper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:mibook/core/designsystem/atoms/colors.dart';

class ProgressStepper extends StatelessWidget {
final double progress;

const ProgressStepper({super.key, required this.progress});

@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Progress: ${(progress * 100).toStringAsFixed(1)}%'),
const SizedBox(height: 8),
LinearProgressIndicator(
value: progress,
minHeight: 8,
backgroundColor: Colors.grey[300],
valueColor: AlwaysStoppedAnimation<Color>(background),
),
],
);
}
}
32 changes: 32 additions & 0 deletions lib/core/designsystem/molecules/indicators/radio_box.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
import 'package:mibook/core/designsystem/atoms/colors.dart';

class RadioBox extends StatelessWidget {
final bool value;
final ValueChanged<bool?> onChanged;
final String label;

const RadioBox({
super.key,
required this.value,
required this.onChanged,
required this.label,
});

@override
Widget build(BuildContext context) {
return InkWell(
onTap: () => onChanged(!value),
child: Row(
children: [
Checkbox(
fillColor: WidgetStateProperty.all(primary),
value: value,
onChanged: onChanged,
),
Text(label),
],
),
);
}
}
43 changes: 33 additions & 10 deletions lib/core/designsystem/molecules/inputfields/input_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class InputField extends StatelessWidget {
final TextEditingController controller;
final bool isEnabled;
final String placeholder;
final String? suffixText;
final String? prefixText;
final String? errorMessage;
final TextInputType? keyboardType;
final Function(String) onChanged;

const InputField({
Expand All @@ -14,6 +18,10 @@ class InputField extends StatelessWidget {
required this.controller,
this.isEnabled = true,
this.placeholder = '',
this.suffixText,
this.prefixText,
this.errorMessage,
this.keyboardType,
required this.onChanged,
});

Expand All @@ -22,19 +30,34 @@ class InputField extends StatelessWidget {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (label.isNotEmpty) Text(label),
if (label.isNotEmpty)
Text(
label,
style: TextStyle(
color: errorMessage == null ? primaryText : error,
),
),
const SizedBox(height: 8),
SizedBox(
height: 48,
child: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: onBorder),
),
TextField(
keyboardType: keyboardType,
decoration: InputDecoration(
border: OutlineInputBorder(),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: onBorder),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(color: error),
),
hintText: placeholder,
suffixText: suffixText,
prefixText: prefixText,
errorText: errorMessage,
contentPadding: const EdgeInsets.symmetric(
vertical: 16, // controls height
horizontal: 16,
),
onChanged: onChanged,
),
onChanged: onChanged,
),
],
);
Expand Down
20 changes: 14 additions & 6 deletions lib/core/designsystem/organisms/app_nav_bar.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:mibook/core/designsystem/modifiers/display_as_loader.dart';

Expand Down Expand Up @@ -65,12 +66,19 @@ class AppNavBar extends StatelessWidget implements PreferredSizeWidget {
Widget _title() {
return DisplayAsLoader(
isLoading: isTitleLoading,
child: Text(
titleText,
style: TextStyle(
color: Colors.black,
fontSize: titleText.length > 20 ? 14 : 22,
fontWeight: FontWeight.bold,
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 250),
child: AutoSizeText(
titleText,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.black,
fontSize: 22,
fontWeight: FontWeight.bold,
),
minFontSize: 12,
stepGranularity: 1,
),
),
);
Expand Down
3 changes: 3 additions & 0 deletions lib/core/designsystem/organisms/list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ class GenericInput extends ListItemInput {

class ListItem extends StatelessWidget {
final ListItemInput input;
final bool isExpanded;
final Function()? onTap;

const ListItem({
super.key,
required this.input,
this.isExpanded = false,
this.onTap,
});

Expand All @@ -86,6 +88,7 @@ class ListItem extends StatelessWidget {
return InkWell(
onTap: onTap,
child: Container(
width: isExpanded ? double.infinity : null,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: onBackground,
Expand Down
3 changes: 2 additions & 1 deletion lib/core/routes/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class AppRouter extends RootStackRouter {
page: SearchRoute.page,
children: [
AutoRoute(page: BookSearchRoute.page),
AutoRoute(page: BoolDetailsRoute.page),
AutoRoute(page: BookDetailsRoute.page),
AutoRoute(page: StartReadingRoute.page),
],
),
AutoRoute(
Expand Down
Loading