Maxio
This commit is contained in:
BIN
assets/images/maxio.png
Normal file
BIN
assets/images/maxio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 157 KiB |
@@ -22,11 +22,20 @@ class _FeedPageState extends State<FeedPage> {
|
|||||||
return Card(
|
return Card(
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(feedItem.text),
|
title: Text(feedItem.text),
|
||||||
subtitle: Text(getTimeString(feedItem.timestamp)),
|
trailing: Row(
|
||||||
trailing: Text(
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Text(getTimeString(feedItem.timestamp)),
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
'${feedItem.timestamp.hour}:${feedItem.timestamp.minute}',
|
'${feedItem.timestamp.hour}:${feedItem.timestamp.minute}',
|
||||||
style: Theme.of(context).textTheme.bodyLarge!.copyWith(),
|
style: Theme.of(context).textTheme.bodyLarge!.copyWith(),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -46,9 +55,11 @@ String getTimeString(DateTime time) {
|
|||||||
} else if (duration.inDays > 1) {
|
} else if (duration.inDays > 1) {
|
||||||
return '${duration.inDays} days ago';
|
return '${duration.inDays} days ago';
|
||||||
} else if (duration.inHours > 0) {
|
} else if (duration.inHours > 0) {
|
||||||
return '${duration.inHours} hours ago';
|
String text = duration.inHours == 1 ? 'hour' : 'hours';
|
||||||
|
return '${duration.inHours} $text ago';
|
||||||
} else if (duration.inMinutes > 0) {
|
} else if (duration.inMinutes > 0) {
|
||||||
return '${duration.inMinutes} minutes ago';
|
String text = duration.inMinutes == 1 ? 'minute' : 'minutes';
|
||||||
|
return '${duration.inMinutes} $text ago';
|
||||||
} else {
|
} else {
|
||||||
return 'just seconds ago';
|
return 'just seconds ago';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:audioplayers/audioplayers.dart';
|
||||||
import '../services/db_helper.dart';
|
import '../services/db_helper.dart';
|
||||||
|
|
||||||
class LoginPage extends StatelessWidget {
|
class LoginPage extends StatefulWidget {
|
||||||
const LoginPage({super.key});
|
const LoginPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<LoginPage> createState() => _LoginPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LoginPageState extends State<LoginPage> {
|
||||||
|
double _height = 0;
|
||||||
|
final player = AudioPlayer();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
double width = MediaQuery.of(context).size.width / 2;
|
double width = MediaQuery.of(context).size.width / 2;
|
||||||
@@ -12,7 +20,19 @@ class LoginPage extends StatelessWidget {
|
|||||||
TextEditingController username = TextEditingController();
|
TextEditingController username = TextEditingController();
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Card(
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: _height > 0 ? 0 : 300),
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 500),
|
||||||
|
height: _height,
|
||||||
|
width: 250,
|
||||||
|
child: Image.asset('assets/images/maxio.png', height: _height),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Card(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(15.0),
|
padding: const EdgeInsets.all(15.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
@@ -30,8 +50,10 @@ class LoginPage extends StatelessWidget {
|
|||||||
const Padding(padding: EdgeInsets.symmetric(vertical: 5)),
|
const Padding(padding: EdgeInsets.symmetric(vertical: 5)),
|
||||||
Text('please enter your first name to get started',
|
Text('please enter your first name to get started',
|
||||||
style: Theme.of(context).textTheme.bodyLarge),
|
style: Theme.of(context).textTheme.bodyLarge),
|
||||||
const Padding(padding: EdgeInsets.symmetric(vertical: 15)),
|
const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 15)),
|
||||||
TextField(
|
TextField(
|
||||||
|
onTap: () => _onTap(),
|
||||||
controller: username,
|
controller: username,
|
||||||
onSubmitted: (value) => DbHelper.login(username.text),
|
onSubmitted: (value) => DbHelper.login(username.text),
|
||||||
textInputAction: TextInputAction.done,
|
textInputAction: TextInputAction.done,
|
||||||
@@ -40,7 +62,8 @@ class LoginPage extends StatelessWidget {
|
|||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Padding(padding: EdgeInsets.symmetric(vertical: 15)),
|
const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 15)),
|
||||||
FloatingActionButton.extended(
|
FloatingActionButton.extended(
|
||||||
onPressed: () => DbHelper.login(username.text),
|
onPressed: () => DbHelper.login(username.text),
|
||||||
label: const Text('READY'),
|
label: const Text('READY'),
|
||||||
@@ -50,7 +73,18 @@ class LoginPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const Padding(padding: EdgeInsets.only(top: 300)),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future _onTap() async {
|
||||||
|
setState(() {
|
||||||
|
_height = 300;
|
||||||
|
});
|
||||||
|
await player.play(UrlSource(
|
||||||
|
'https://vhmrtvhcmvylhrhblyjb.supabase.co/storage/v1/object/public/audio/itsMeMax.mp3'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
80
pubspec.lock
80
pubspec.lock
@@ -17,6 +17,62 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.11.0"
|
version: "2.11.0"
|
||||||
|
audioplayers:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: audioplayers
|
||||||
|
sha256: d9f6ca8e9b3e5af5e73d4c814404566f72698ee7ba35487bdf2baa6749e7503f
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.2.0"
|
||||||
|
audioplayers_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_android
|
||||||
|
sha256: fb01b9481f431fe04ac60f1f97ce8158383f2dc754558820592f795d81ca9d53
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.2"
|
||||||
|
audioplayers_darwin:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_darwin
|
||||||
|
sha256: "3034e99a6df8d101da0f5082dcca0a2a99db62ab1d4ddb3277bed3f6f81afe08"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.0.2"
|
||||||
|
audioplayers_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_linux
|
||||||
|
sha256: "60787e73fefc4d2e0b9c02c69885402177e818e4e27ef087074cf27c02246c9e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
|
audioplayers_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_platform_interface
|
||||||
|
sha256: "365c547f1bb9e77d94dd1687903a668d8f7ac3409e48e6e6a3668a1ac2982adb"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.0"
|
||||||
|
audioplayers_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_web
|
||||||
|
sha256: "22cd0173e54d92bd9b2c80b1204eb1eb159ece87475ab58c9788a70ec43c2a62"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.0"
|
||||||
|
audioplayers_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_windows
|
||||||
|
sha256: "9536812c9103563644ada2ef45ae523806b0745f7a78e89d1b5fb1951de90e1a"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -429,6 +485,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
version: "1.10.0"
|
||||||
|
sprintf:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sprintf
|
||||||
|
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "7.0.0"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -477,6 +541,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.22"
|
version: "1.10.22"
|
||||||
|
synchronized:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: synchronized
|
||||||
|
sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -565,6 +637,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.8"
|
version: "3.0.8"
|
||||||
|
uuid:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: uuid
|
||||||
|
sha256: b715b8d3858b6fa9f68f87d20d98830283628014750c2b09b6f516c1da4af2a7
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.0"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ dependencies:
|
|||||||
shared_preferences: ^2.2.2
|
shared_preferences: ^2.2.2
|
||||||
provider: ^6.0.5
|
provider: ^6.0.5
|
||||||
supabase_flutter: ^1.10.22
|
supabase_flutter: ^1.10.22
|
||||||
|
audioplayers: ^5.2.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
@@ -23,6 +24,8 @@ dev_dependencies:
|
|||||||
flutter_lints: ^3.0.0
|
flutter_lints: ^3.0.0
|
||||||
flutter:
|
flutter:
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
|
assets:
|
||||||
|
- assets/images/maxio.png
|
||||||
fonts:
|
fonts:
|
||||||
- family: Ubuntu
|
- family: Ubuntu
|
||||||
fonts:
|
fonts:
|
||||||
|
|||||||
Reference in New Issue
Block a user