All checks were successful
Build and release APK / Build APK (pull_request) Successful in 5m24s
34 lines
808 B
Dart
34 lines
808 B
Dart
|
|
import 'package:anyway/structs/trip.dart';
|
|
import 'package:auto_size_text/auto_size_text.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
Widget saveButton(Trip trip) => ElevatedButton(
|
|
onPressed: () async {
|
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
|
trip.toPrefs(prefs);
|
|
},
|
|
child: SizedBox(
|
|
width: 100,
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Icon(
|
|
Icons.save,
|
|
),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: EdgeInsets.only(left: 10, top: 5, bottom: 5, right: 5),
|
|
child: AutoSizeText(
|
|
'Save trip',
|
|
maxLines: 2,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
)
|
|
);
|
|
|