Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major PR before 1.0.0 #23

Merged
merged 34 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b3f50ed
Add global snackbar class
hkamran80 Nov 8, 2022
e8144b9
Remove global snackbar class
hkamran80 Nov 8, 2022
58e74be
Add `fluttertoast`
hkamran80 Nov 8, 2022
5dce35c
Add basic copy-to-clipboard and toast
hkamran80 Nov 8, 2022
0ec31b8
Trim period names
hkamran80 Nov 8, 2022
f7d26c3
Add new string extensions
hkamran80 Nov 8, 2022
3d420d1
Add `exportId` getter
hkamran80 Nov 8, 2022
a0ce6ea
Add export functionality
hkamran80 Nov 8, 2022
e94e982
Remove extraneous variable
hkamran80 Nov 8, 2022
346ae9d
Add export button to settings menu
hkamran80 Nov 8, 2022
1a02139
Add the import screen
hkamran80 Nov 10, 2022
dc9e9cc
WIP: Add import functionality
hkamran80 Nov 10, 2022
785336b
Add import screen
hkamran80 Nov 10, 2022
87f94e7
Add import button
hkamran80 Nov 10, 2022
c6ffed2
Add custom errors
hkamran80 Nov 10, 2022
72a2de3
Switch to global provider (#22)
hkamran80 Nov 10, 2022
ab13224
Merge branch 'feature/6-import-export' of https://github.com/hkamran8…
hkamran80 Nov 10, 2022
67e0754
Remove defunct import statements
hkamran80 Nov 10, 2022
d5b6e27
Add import functionality
hkamran80 Nov 10, 2022
869ee76
Change output type of import function to `String`
hkamran80 Nov 10, 2022
ab63e91
Switch to `String` for import result
hkamran80 Nov 10, 2022
cae832e
Add period name edit function
hkamran80 Nov 10, 2022
7ed2283
Remove custom errors
hkamran80 Nov 10, 2022
2f4acc6
Remove unused `periodNames` variable
hkamran80 Nov 10, 2022
3e7c928
Close issue #9
hkamran80 Nov 10, 2022
413a665
Remove unused setter
hkamran80 Nov 10, 2022
e3044d5
Remove TODO
hkamran80 Nov 10, 2022
9f98753
Switch to relative path for imports
hkamran80 Nov 10, 2022
a641d9f
Switch to relative paths for imports
hkamran80 Nov 10, 2022
ec7cdea
Remove defunct comment
hkamran80 Nov 10, 2022
e7fb165
Add text selection theming
hkamran80 Nov 10, 2022
51ce31b
Update release notes
hkamran80 Nov 10, 2022
7da8ed8
Add done button
hkamran80 Nov 10, 2022
63925f6
Update iOS settings
hkamran80 Nov 10, 2022
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
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>9.0</string>
<string>11.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, '9.0'
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
10 changes: 10 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ PODS:
- Flutter (1.0.0)
- flutter_local_notifications (0.0.1):
- Flutter
- fluttertoast (0.0.2):
- Flutter
- Toast
- package_info_plus (0.4.5):
- Flutter
- path_provider_ios (0.0.1):
Expand All @@ -15,12 +18,14 @@ PODS:
- Sentry (~> 7.22.0)
- shared_preferences_ios (0.0.1):
- Flutter
- Toast (4.0.0)
- url_launcher_ios (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
Expand All @@ -30,12 +35,15 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- Sentry
- Toast

EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_ios:
Expand All @@ -50,11 +58,13 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
fluttertoast: 74526702fea2c060ea55dde75895b7e1bde1c86b
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
Sentry: 30b51086ca9aac23337880152e95538f7e177f7f
sentry_flutter: eaca55af5c951f4be6c4b1daddce1744c37d8476
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
Expand Down
21 changes: 12 additions & 9 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,16 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = KJA9PT3WHP;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = DYJ355N6M8;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.hkamran.schedules;
MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.13willow.schedules;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -483,15 +484,16 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = KJA9PT3WHP;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = DYJ355N6M8;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.hkamran.schedules;
MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.13willow.schedules;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -506,15 +508,16 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = KJA9PT3WHP;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = DYJ355N6M8;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.hkamran.schedules;
MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.13willow.schedules;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
96 changes: 49 additions & 47 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
@@ -1,51 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Schedules</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Schedules</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>https</string>
</array>
</dict>
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Schedules</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Schedules</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>https</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
16 changes: 13 additions & 3 deletions lib/extensions/string.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ extension StringDateTime on String {
}

extension StringRegExp on String {
String slugify() => replaceAll(RegExp('[^A-Za-z0-9]'), "")
.replaceAll(" ", "-")
.toLowerCase();
String slugify() =>
replaceAll(RegExp('[^A-Za-z0-9]'), "",).replaceAll(" ", "-").toLowerCase();
}

// Source: https://stackoverflow.com/a/29629114/7313822
extension StringCasingExtension on String {
String toCapitalized() =>
length > 0 ? '${this[0].toUpperCase()}${substring(1).toLowerCase()}' : '';

String toTitleCase() => replaceAll(RegExp(' +'), ' ')
.split(' ')
.map((str) => str.toCapitalized())
.join(' ');
}
46 changes: 15 additions & 31 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:provider/provider.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'screens/import_settings.dart';
import 'screens/notification_settings.dart';
import 'screens/period_name_settings.dart';
import 'secrets.dart';
Expand All @@ -13,7 +14,6 @@ import 'screens/home.dart';
import 'screens/schedule.dart';
import 'screens/settings.dart';
import 'utils/notification_service.dart';
import 'utils/schedule.dart';

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
Expand Down Expand Up @@ -52,7 +52,6 @@ class SchedulesApp extends StatelessWidget {
primarySwatch: Colors.pink,
textTheme: GoogleFonts.nunitoSansTextTheme(),
useMaterial3: true,
// typography
),
darkTheme: ThemeData(
useMaterial3: true,
Expand Down Expand Up @@ -81,6 +80,11 @@ class SchedulesApp extends StatelessWidget {
),
),
),
textSelectionTheme: const TextSelectionThemeData(
cursorColor: Colors.pink,
selectionColor: Colors.pink,
selectionHandleColor: Colors.pink,
),
toggleableActiveColor: Colors.pink,
primaryColor: Colors.white,
),
Expand All @@ -94,58 +98,38 @@ class SchedulesApp extends StatelessWidget {
.settings
.arguments as ScheduleScreenArguments;

SchedulesProvider schedulesData =
Provider.of<SchedulesProvider>(context);

return ScheduleScreen(
args: args,
schedulesData: schedulesData,
schedule: Schedule(
args.scheduleId,
schedulesData.schedules[args.scheduleId],
),
scheduleId: args.scheduleId,
);
},
ScheduleNotificationsSettingsScreen.routeName: (context) {
ScheduleScreenArguments args = ModalRoute.of(context)!
.settings
.arguments as ScheduleScreenArguments;

SchedulesProvider schedulesData =
Provider.of<SchedulesProvider>(context);

return ScheduleNotificationsSettingsScreen(
scheduleId: args.scheduleId,
schedulesData: schedulesData,
schedule: Schedule(
args.scheduleId,
schedulesData.schedules[args.scheduleId],
),
);
},
SchedulePeriodNamesSettingsScreen.routeName: (context) {
ScheduleScreenArguments args = ModalRoute.of(context)!
.settings
.arguments as ScheduleScreenArguments;

SchedulesProvider schedulesData =
Provider.of<SchedulesProvider>(context);

return SchedulePeriodNamesSettingsScreen(
scheduleId: args.scheduleId,
schedulesData: schedulesData,
schedule: Schedule(
args.scheduleId,
schedulesData.schedules[args.scheduleId],
),
);
},
SettingsScreen.routeName: (context) {
SchedulesProvider schedulesData =
Provider.of<SchedulesProvider>(context);
ImportSettingsScreen.routeName: (context) {
ScheduleScreenArguments args = ModalRoute.of(context)!
.settings
.arguments as ScheduleScreenArguments;

return SettingsScreen(schedulesData: schedulesData);
return ImportSettingsScreen(
scheduleId: args.scheduleId,
);
},
SettingsScreen.routeName: (context) => const SettingsScreen(),
AboutScreen.routeName: (context) => const AboutScreen(),
},
);
Expand Down
7 changes: 6 additions & 1 deletion lib/notification_constants.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:schedules/extensions/string.dart';
import 'extensions/string.dart';

class NotificationInterval {
List<int> array;
Expand All @@ -10,6 +10,11 @@ class NotificationInterval {
});

String get id => name.slugify();
String get exportId {
List<String> exported = name.split(" ");
return exported[0].toLowerCase() + exported[1].toCapitalized();
}

Duration get duration => Duration(
hours: array[0],
minutes: array[1],
Expand Down
Loading