flutter time babey
This commit is contained in:
commit
98798fa14f
134 changed files with 4587 additions and 0 deletions
5
lib/pages/chat/ chat.dart
Normal file
5
lib/pages/chat/ chat.dart
Normal file
|
@ -0,0 +1,5 @@
|
|||
import 'package:flutter/widgets.dart';
|
||||
|
||||
Widget Chat() {
|
||||
return Center(child: Text("Chat"));
|
||||
}
|
70
lib/pages/login.dart
Normal file
70
lib/pages/login.dart
Normal file
|
@ -0,0 +1,70 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:slothmu/api/user.dart';
|
||||
|
||||
class Login extends StatefulWidget {
|
||||
const Login({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<Login> createState() => _LoginState();
|
||||
}
|
||||
|
||||
class _LoginState extends State<Login> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
body: Padding(
|
||||
padding: EdgeInsets.all(24),
|
||||
child: LoginForm(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class LoginForm extends StatefulWidget {
|
||||
const LoginForm({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<LoginForm> createState() => _LoginFormState();
|
||||
}
|
||||
|
||||
class _LoginFormState extends State<LoginForm> {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Form(
|
||||
onChanged: () {
|
||||
formKey.currentState!.validate();
|
||||
},
|
||||
key: formKey,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
const Text("Welcome!", style: TextStyle(fontSize: 64)),
|
||||
TextFormField(
|
||||
decoration: const InputDecoration(
|
||||
labelText: "user id",
|
||||
hintText: "user@example.com",
|
||||
icon: Icon(Icons.person),
|
||||
prefixText: "@",
|
||||
),
|
||||
autofocus: true,
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || !isValidUsername(name: value)) {
|
||||
return "Sorry, this user id doesn't look quite right...";
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
),
|
||||
TextButton.icon(
|
||||
onPressed: () {
|
||||
final isValid = formKey.currentState!.validate();
|
||||
},
|
||||
icon: Icon(Icons.login),
|
||||
label: Text("authorize in browser"))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
15
lib/pages/settings/settings.dart
Normal file
15
lib/pages/settings/settings.dart
Normal file
|
@ -0,0 +1,15 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:settings_ui/settings_ui.dart';
|
||||
|
||||
Widget Settings() {
|
||||
return SafeArea(
|
||||
child: SettingsList(contentPadding: EdgeInsets.all(24), sections: [
|
||||
SettingsSection(title: Text("General"), tiles: [
|
||||
SettingsTile(
|
||||
title: Text("Language"),
|
||||
value: Text("no"),
|
||||
)
|
||||
])
|
||||
]),
|
||||
);
|
||||
}
|
5
lib/pages/timeline/timeline.dart
Normal file
5
lib/pages/timeline/timeline.dart
Normal file
|
@ -0,0 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
Widget Timeline() {
|
||||
return Center(child: Text("Home"));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue