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

Migrate deprecated APIs #13

Closed
wants to merge 7 commits into from
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>8.0</string>
<string>9.0</string>
</dict>
</plist>
7 changes: 5 additions & 2 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def flutter_root
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
Expand All @@ -30,12 +30,15 @@ flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
6 changes: 3 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ SPEC CHECKSUMS:
FirebaseInstanceID: ad5135045a498d7775903efd39762d2cdfa1be27
FirebaseMessaging: 163435fb6db065e3b6228f1e577b10ed2cc506d2
FirebaseRemoteConfig: 0ea30de5fb0231df8c1bdcdf3b6c23bdc5066131
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GoogleDataTransport: cd9db2180fcecd8da1b561aea31e3e56cf834aa7
Expand All @@ -173,6 +173,6 @@ SPEC CHECKSUMS:
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
PODFILE CHECKSUM: 2c1172121d7e54f5012361bdacbf0587d146212a

COCOAPODS: 1.10.0
COCOAPODS: 1.11.2
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
19C99266E3771CEEC44CEE8E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
2592EE42265141B5008C227E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../GoogleService-Info.plist"; sourceTree = "<group>"; };
2592EE42265141B5008C227E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../GoogleService-Info.plist"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
42F03E5B9EF47767B221E891 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
Expand Down
7 changes: 4 additions & 3 deletions lib/components/athkar_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ class AthkarCard extends StatelessWidget {
'${counter.position}'.arabicDigit(),
key: ValueKey<int?>(counter.position),
style: TextStyle(
color: Theme.of(context).accentColor,
fontSize: 16,
height: 1.25),
color: Theme.of(context).colorScheme.secondary,
fontSize: 16,
height: 1.25,
),
),
),
decoration: BoxDecoration(
Expand Down
8 changes: 6 additions & 2 deletions lib/components/card_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ class CardText extends StatelessWidget {
children.add(
TextSpan(
text: m,
style: TextStyle(color: Theme.of(context).buttonColor),
style: TextStyle(
color: Theme.of(context).buttonTheme.colorScheme!.primary,
),
),
);
} else {
Expand All @@ -132,7 +134,9 @@ class CardText extends StatelessWidget {
children.add(
TextSpan(
text: s,
style: TextStyle(color: Theme.of(context).buttonColor),
style: TextStyle(
color: Theme.of(context).buttonTheme.colorScheme!.primary,
),
),
);
} else {
Expand Down
29 changes: 23 additions & 6 deletions lib/constants/theme.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

const double kContentFontSize = 16.0;

ThemeData lightTheme() => ThemeData(
brightness: Brightness.light,
appBarTheme: AppBarTheme(brightness: Brightness.light),
appBarTheme: AppBarTheme(
systemOverlayStyle: SystemUiOverlayStyle.light,
),
fontFamily: 'SST Arabic',
primaryColor: Color(0xff6db7e5),
pageTransitionsTheme: PageTransitionsTheme(
Expand All @@ -15,7 +18,9 @@ ThemeData lightTheme() => ThemeData(
unselectedWidgetColor: Colors.grey[300],
canvasColor: Colors.white,
dividerColor: Colors.grey[300],
accentColor: Color(0xff6f85d5),
colorScheme: ColorScheme.light().copyWith(
secondary: Color(0xff6f85d5),
),
dialogTheme: DialogTheme(backgroundColor: Colors.white),
highlightColor: Colors.black.withOpacity(0.1),
splashColor: Colors.black.withOpacity(0.1),
Expand Down Expand Up @@ -58,13 +63,19 @@ ThemeData lightTheme() => ThemeData(
filled: true,
hintStyle: TextStyle(color: Colors.grey),
),
buttonColor: Color(0xff6f85d5),
buttonTheme: ButtonThemeData(
colorScheme: ColorScheme.light().copyWith(
primary: Color(0xff6f85d5),
),
),
cardColor: Colors.grey[200],
);

ThemeData darkTheme() => ThemeData(
brightness: Brightness.dark,
appBarTheme: AppBarTheme(brightness: Brightness.dark),
appBarTheme: AppBarTheme(
systemOverlayStyle: SystemUiOverlayStyle.dark,
),
fontFamily: 'SST Arabic',
primaryColor: Color(0xff6db7e5),
pageTransitionsTheme: PageTransitionsTheme(
Expand Down Expand Up @@ -110,8 +121,14 @@ ThemeData darkTheme() => ThemeData(
height: 1,
),
),
accentColor: Colors.white,
buttonColor: Color(0xff6f85d5),
colorScheme: ColorScheme.dark().copyWith(
secondary: Colors.white,
),
buttonTheme: ButtonThemeData(
colorScheme: ColorScheme.dark().copyWith(
primary: Color(0xff6f85d5),
),
),
splashColor: Colors.black.withOpacity(0.1),
highlightColor: Color(0xff3C387B).withOpacity(0.5),
dialogTheme: DialogTheme(backgroundColor: Color(0xff1B2349)),
Expand Down
4 changes: 3 additions & 1 deletion lib/pages/tabs/1_home/ad3yah_expanded.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ class _Ad3yahListState extends State<Ad3yahList> {
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headline1,
),
NoorCloseButton(color: Theme.of(context).accentColor),
NoorCloseButton(
color: Theme.of(context).colorScheme.secondary,
),
],
),
),
Expand Down
8 changes: 6 additions & 2 deletions lib/pages/tabs/1_home/allah_names_expanded.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ class _AllahNamesListState extends State<AllahNamesList>
},
),
),
NoorCloseButton(color: Theme.of(context).accentColor),
NoorCloseButton(
color: Theme.of(context).colorScheme.secondary,
),
],
),
),
Expand Down Expand Up @@ -223,7 +225,9 @@ class ReferenceList extends StatelessWidget {
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headline1,
),
NoorCloseButton(color: Theme.of(context).accentColor),
NoorCloseButton(
color: Theme.of(context).colorScheme.secondary,
),
],
),
),
Expand Down
4 changes: 3 additions & 1 deletion lib/pages/tabs/1_home/athkar_expanded.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ class _AthkarListState extends State<AthkarList>
},
),
),
NoorCloseButton(color: Theme.of(context).accentColor),
NoorCloseButton(
color: Theme.of(context).colorScheme.secondary,
),
],
),
),
Expand Down
1 change: 0 additions & 1 deletion lib/pages/tabs/1_home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ class _AnimatedHeaderState extends State<AnimatedHeader>
return AnimatedSize(
curve: Curves.easeInOutCirc,
duration: Duration(milliseconds: 300),
vsync: this,
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/tabs/1_home/my_ad3yah.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class _MyAd3yahState extends State<MyAd3yah> with TickerProviderStateMixin {
child: SingleChildScrollView(
child: TextField(
controller: controller,
style: Theme.of(context).textTheme.body1,
style: Theme.of(context).textTheme.bodyText2,
decoration: InputDecoration(
filled: false,
contentPadding:
Expand Down
39 changes: 21 additions & 18 deletions lib/pages/tabs/4_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,8 @@ class _SettingsState extends State<Settings>
.bold,
color: Theme.of(
context)
.accentColor,
.colorScheme
.secondary,
fontSize: 12),
),
onPressed: () async {
Expand Down Expand Up @@ -617,13 +618,14 @@ class _SettingsState extends State<Settings>
.textTheme
.bodyText1!
.copyWith(
fontWeight:
FontWeight
.bold,
color: Theme.of(
context)
.accentColor,
fontSize: 12),
fontWeight:
FontWeight.bold,
color: Theme.of(
context)
.colorScheme
.secondary,
fontSize: 12,
),
),
onPressed: () {
Navigator.of(context)
Expand Down Expand Up @@ -761,7 +763,8 @@ class _SettingsState extends State<Settings>
.bold,
color: Theme.of(
context)
.accentColor,
.colorScheme
.secondary,
fontSize: 12),
),
onPressed: () async {
Expand Down Expand Up @@ -811,13 +814,14 @@ class _SettingsState extends State<Settings>
.textTheme
.bodyText1!
.copyWith(
fontWeight:
FontWeight
.bold,
color: Theme.of(
context)
.accentColor,
fontSize: 12),
fontWeight:
FontWeight.bold,
color: Theme.of(
context)
.colorScheme
.secondary,
fontSize: 12,
),
),
onPressed: () {
Navigator.of(context)
Expand Down Expand Up @@ -845,7 +849,7 @@ class _SettingsState extends State<Settings>
fontSize: 16,
color: Theme.of(context)
.textTheme
.body1!
.bodyText2!
.color,
),
),
Expand Down Expand Up @@ -1049,7 +1053,6 @@ class _SettingsState extends State<Settings>
? activeLabelStyle
: inactiveLabelStyle,
),
vsync: this,
duration: Duration(milliseconds: 500),
);
}
Expand Down