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

fix: fixed issues with upgrading to newer sdk #271

Open
wants to merge 7 commits into
base: google-api-error
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.atsign.wavi"
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
14 changes: 6 additions & 8 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ import 'package:at_wavi_app/view_models/theme_view_model.dart';
import 'package:at_wavi_app/view_models/user_preview.dart';
import 'package:at_wavi_app/view_models/user_provider.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:provider/provider.dart';

import 'desktop/routes/desktop_routes.dart';
import 'desktop/services/theme/app_theme.dart';
import 'desktop/services/theme/inherited_app_theme.dart';

class MyApp extends StatefulWidget {
MyApp();
const MyApp({Key? key}) : super(key: key);

@override
_MyAppState createState() => _MyAppState();
Expand Down Expand Up @@ -78,15 +77,14 @@ class MaterialAppClass extends StatelessWidget {
final String? initialRoute;
final Map<String, WidgetBuilder> routes;

MaterialAppClass({
const MaterialAppClass({Key? key,
required this.initialRoute,
required this.routes,
});
}) : super(key: key);

@override
Widget build(BuildContext context) {
var brightness = SchedulerBinding.instance.window.platformBrightness;

var brightness = MediaQuery.platformBrightnessOf(context);
/// MaterialApp for desktop
if (Platform.isMacOS || Platform.isWindows || Platform.isLinux) {
/// Mock data
Expand Down Expand Up @@ -123,7 +121,7 @@ class MaterialAppClass extends StatelessWidget {
builder: (BuildContext context, Widget? child) {
final data = MediaQuery.of(context);
return MediaQuery(
data: data.copyWith(textScaleFactor: 1),
data: data.copyWith(textScaler: const TextScaler.linear(1)),
child: child!,
);
},
Expand All @@ -149,7 +147,7 @@ class MaterialAppClass extends StatelessWidget {
if (Platform.isIOS) hideKeyboard(context);
},
child: MediaQuery(
data: data.copyWith(textScaleFactor: 1),
data: data.copyWith(textScaler: const TextScaler.linear(1)),
child: child!,
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/common_components/add_custom_content_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AddCustomContentButton extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
const Icon(
Icons.add,
color: ColorConstants.orange,
),
Expand Down
20 changes: 10 additions & 10 deletions lib/common_components/confirmation_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ import 'package:flutter/material.dart';
import 'custom_button.dart';

Future<bool?> confirmationDialog(String atsign) async {
bool? _choice;
bool? choice;
await showDialog<bool>(
context: NavService.navKey.currentContext!,
barrierDismissible: true,
builder: (BuildContext context) {
return Container(
return SizedBox(
width: SizeConfig().screenWidth * 0.8,
child: AlertDialog(
backgroundColor: Theme.of(context).brightness == Brightness.light
? Colors.white
: ColorConstants.darkGrey,
contentPadding: EdgeInsets.fromLTRB(15, 30, 15, 20),
contentPadding: const EdgeInsets.fromLTRB(15, 30, 15, 20),
content: SingleChildScrollView(
child: Container(
child: Column(
Expand All @@ -30,11 +30,11 @@ Future<bool?> confirmationDialog(String atsign) async {
style: TextStyles.grey16,
textAlign: TextAlign.center,
),
SizedBox(height: 30),
const SizedBox(height: 30),
CustomButton(
onTap: () {
_choice = true;
Navigator.pop(NavService.navKey.currentContext!, _choice);
choice = true;
Navigator.pop(NavService.navKey.currentContext!, choice);
},
bgColor: Theme.of(context).primaryColor,
highlightColor:
Expand All @@ -50,11 +50,11 @@ Future<bool?> confirmationDialog(String atsign) async {
color: Theme.of(context).scaffoldBackgroundColor),
),
),
SizedBox(height: 10),
const SizedBox(height: 10),
CustomButton(
onTap: () {
_choice = false;
Navigator.pop(NavService.navKey.currentContext!, _choice);
choice = false;
Navigator.pop(NavService.navKey.currentContext!, choice);
},
bgColor: Theme.of(context).brightness == Brightness.light
? Theme.of(context).scaffoldBackgroundColor
Expand All @@ -80,5 +80,5 @@ Future<bool?> confirmationDialog(String atsign) async {
);
},
);
return _choice;
return choice;
}
6 changes: 3 additions & 3 deletions lib/common_components/contact_initial.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ class ContactInitial extends StatelessWidget {
final double? size;
final String? initials;

ContactInitial({
const ContactInitial({Key? key,
this.size = 40,
@required this.initials,
});
}) : super(key: key);
@override
Widget build(BuildContext context) {
var index = 3;
Expand All @@ -29,7 +29,7 @@ class ContactInitial extends StatelessWidget {
child: Center(
child: Text(
initials!.substring((index == 1) ? 0 : 1, index).toUpperCase(),
style: TextStyle(color: Colors.white, fontSize: 16),
style: const TextStyle(color: Colors.white, fontSize: 16),
),
),
);
Expand Down
6 changes: 3 additions & 3 deletions lib/common_components/content_edit_field_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ class ContentEditFieldCard extends StatefulWidget {
final String title, subtitle;
final bool isPrivate;
final ThemeData theme;
ContentEditFieldCard(
{required this.theme,
const ContentEditFieldCard(
{Key? key, required this.theme,
required this.title,
required this.subtitle,
this.isPrivate = true});
this.isPrivate = true}) : super(key: key);
// ContentEditFieldCard({
// required this.title,
// required this.subtitle,
Expand Down
2 changes: 1 addition & 1 deletion lib/common_components/create_marker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Widget createMarker({
height: diameterOfCircle,
child: CustomPaint(
painter: CircleMarkerPainter(
color: Color(0xFFF47B5D).withOpacity(0.2),
color: const Color(0xFFF47B5D).withOpacity(0.2),
paintingStyle: PaintingStyle.fill),
),
),
Expand Down
8 changes: 4 additions & 4 deletions lib/common_components/custom_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CustomButton extends StatelessWidget {
final Border? border;
final Color? highlightColor;

CustomButton({
const CustomButton({Key? key,
required this.child,
this.height = 50,
required this.onTap,
Expand All @@ -21,7 +21,7 @@ class CustomButton extends StatelessWidget {
this.radius,
this.border,
this.highlightColor,
});
}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand All @@ -33,10 +33,10 @@ class CustomButton extends StatelessWidget {
alignment: Alignment.center,
width: width.toWidth,
height: height.toHeight,
padding: padding ?? EdgeInsets.all(0),
padding: padding ?? const EdgeInsets.all(0),
decoration: BoxDecoration(
color: bgColor,
border: border ?? Border(),
border: border ?? const Border(),
borderRadius: BorderRadius.circular(radius ?? 30)),
child: child,
),
Expand Down
14 changes: 7 additions & 7 deletions lib/common_components/custom_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ class CustomCard extends StatelessWidget {
final String? url;
final bool isEmail;
final ThemeData themeData;
CustomCard(
{this.title,
const CustomCard(
{Key? key, this.title,
this.isEmail = false,
this.url,
required this.subtitle,
this.isUrl = false,
required this.themeData});
required this.themeData}) : super(key: key);

@override
Widget build(BuildContext context) {
return Container(
color: themeData.backgroundColor,
color: themeData.colorScheme.surface,
child: Padding(
padding: const EdgeInsets.all(15),
child: Column(
Expand All @@ -37,8 +37,8 @@ class CustomCard extends StatelessWidget {
themeData.primaryColor.withOpacity(0.5),
size: 16),
)
: SizedBox(),
SizedBox(height: 6),
: const SizedBox(),
const SizedBox(height: 6),
subtitle != null
? GestureDetector(
onTap: () async {
Expand Down Expand Up @@ -77,7 +77,7 @@ class CustomCard extends StatelessWidget {
),
),
)
: SizedBox(),
: const SizedBox(),
],
),
),
Expand Down
Loading