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

Removed depriciated package withopacity #248

Open
wants to merge 3 commits into
base: main
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 lib/core/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Utils {
)
],
),
backgroundColor: kLightBlue.withOpacity(0.8),
backgroundColor: kLightBlue.withValues(alpha: 0.8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10),
Expand Down
18 changes: 11 additions & 7 deletions lib/presentation/auth/auth_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ class _AuthScreenState extends State<AuthScreen>
final authCubit = BlocProvider.of<AuthCubit>(context);
return PopScope(
canPop: false,
onPopInvoked: (didPop) async {
bool? popped = await onPopHome();

if (popped == true) {
await SystemNavigator.pop();
}
},
onPopInvokedWithResult: (bool didPop, Object? result) async {
if (didPop) {
return;
}

bool? popped = await onPopHome();
if (popped == true) {
await SystemNavigator.pop();
}
return;
},
child: BlocConsumer<AuthCubit, AuthState>(
listener: (context, state) {
if (state is SuccessState) {
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/group/widgets/beacon_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class _BeaconCardState extends State<BeaconCard> {
'${widget.beacon.title} is now active! \nYou can join the hike',
style: TextStyle(color: Colors.black),
),
backgroundColor: kLightBlue.withOpacity(0.8),
backgroundColor: kLightBlue.withValues(alpha: 0.8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class LocationCubit extends Cubit<LocationState> {
))
],
),
backgroundColor: kLightBlue.withOpacity(0.8),
backgroundColor: kLightBlue.withValues(alpha:0.8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(10),
Expand Down Expand Up @@ -526,8 +526,8 @@ class LocationCubit extends Cubit<LocationState> {
circleId: CircleId('rippleCircle$index'),
center: locationToLatLng(user.location!),
radius: radius < 0 ? 0 : radius,
fillColor: Colors.red.withOpacity((0.5).clamp(0.0, 1.0)),
strokeColor: Colors.red.withOpacity(0.5),
fillColor: Colors.red.withValues(alpha:(0.5).clamp(0.0, 1.0)),
strokeColor: Colors.red.withValues(alpha: .5),
strokeWidth: 2,
);
});
Expand Down Expand Up @@ -752,7 +752,7 @@ class LocationCubit extends Cubit<LocationState> {
radius: radius,
strokeColor: Colors.blue,
strokeWidth: 2,
fillColor: Colors.blue.withOpacity(0.1),
fillColor: Colors.blue.withValues(alpha:0.1),
));
}
emit(LoadedLocationState(
Expand Down
16 changes: 10 additions & 6 deletions lib/presentation/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,17 @@ class _HomeScreenState extends State<HomeScreen> {
Widget build(BuildContext context) {
return PopScope(
canPop: false,
onPopInvoked: (didPop) async {
bool? popped = await _onPopHome(context);
onPopInvokedWithResult: (bool didPop, Object? result) async {
if (didPop) {
return;
}

bool? popped = await _onPopHome(context);
if (popped == true) {
await SystemNavigator.pop();
}
},

if (popped == true) {
await SystemNavigator.pop();
}
},
child: BlocConsumer<HomeCubit, HomeState>(
listener: (context, state) {
if (state is LoadedHomeState) {
Expand Down
Loading
Loading