Skip to content

Commit

Permalink
Merge pull request #1826 from declaire/shuttleLimit
Browse files Browse the repository at this point in the history
Fixed theme of snackbar for limiting shuttle stops
  • Loading branch information
c3bryant authored Aug 26, 2022
2 parents 3306015 + 1444760 commit 543dc93
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/ui/shuttle/manage_shuttle_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:campus_mobile_experimental/core/providers/shuttle.dart';
import 'package:campus_mobile_experimental/ui/common/container_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:provider/provider.dart';

class ManageShuttleView extends StatefulWidget {
Expand Down Expand Up @@ -87,7 +89,18 @@ class _ManageShuttleViewState extends State<ManageShuttleView> {
),
backgroundColor: ColorPrimary,
onPressed: () {
Navigator.pushNamed(context, RoutePaths.AddShuttleStopsView);
if (_shuttleDataProvider.stopsToRender.length < 5) {
Navigator.pushNamed(context, RoutePaths.AddShuttleStopsView);
}
else {
Get.snackbar(
'Error:',
'Please remove a stop to add more.',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Theme.of(context).colorScheme.primary,
colorText: Colors.white,
);
}
},
),
),
Expand Down

0 comments on commit 543dc93

Please sign in to comment.