Skip to content

Commit

Permalink
Switch to schedule card, move toasts to bottom (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkamran80 authored Nov 22, 2022
1 parent cc1b931 commit 65506f8
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions lib/screens/import_settings.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:provider/provider.dart';
import 'package:schedules/widgets/schedule_card.dart';

import '../provider/schedules.dart';

Expand Down Expand Up @@ -81,12 +82,9 @@ class _ImportSettingsScreenState extends State<ImportSettingsScreen> {
maxLines: null,
),
const SizedBox(height: 25),
ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white,
alignment: Alignment.centerLeft,
backgroundColor: Colors.pink,
),
ScheduleCard(
name: "Import",
backgroundColor: Colors.pink,
onPressed: () async {
if (importTextController.text.trim().isNotEmpty) {
String result = await schedule.importSettings(
Expand All @@ -99,7 +97,7 @@ class _ImportSettingsScreenState extends State<ImportSettingsScreen> {
Fluttertoast.showToast(
msg: "Successfully imported settings!",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.green,
textColor: Colors.white,
Expand All @@ -109,7 +107,7 @@ class _ImportSettingsScreenState extends State<ImportSettingsScreen> {
Fluttertoast.showToast(
msg: "Error: $result",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
Expand All @@ -118,20 +116,6 @@ class _ImportSettingsScreenState extends State<ImportSettingsScreen> {
}
}
},
child: const Padding(
padding: EdgeInsets.fromLTRB(
0,
15,
0,
15,
),
child: Text(
"Import",
style: TextStyle(
fontSize: 16.0,
),
),
),
),
],
),
Expand Down

0 comments on commit 65506f8

Please sign in to comment.