scaling the timeline
This commit is contained in:
parent
c63f062640
commit
ee081de0ab
14 changed files with 202 additions and 63 deletions
|
@ -1,9 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:slothmu/business_logic/user.dart';
|
||||
import 'package:localization/localization.dart';
|
||||
import '../business_logic/auth/oauth.dart' as oauth;
|
||||
import '../business_logic/settings.dart' as settings;
|
||||
import '../business_logic/user.dart' as user;
|
||||
|
||||
class Login extends StatefulWidget {
|
||||
const Login({Key? key}) : super(key: key);
|
||||
|
@ -47,23 +45,15 @@ class _LoginFormState extends State<LoginForm> {
|
|||
Text("greeting".i18n(), style: Theme.of(context).textTheme.headline1),
|
||||
TextFormField(
|
||||
onSaved: (value) async {
|
||||
await settings
|
||||
.saveInstanceUrl(user.urlFromUsername(name: value!));
|
||||
await settings.saveUsername(user.userFromUsername(name: value));
|
||||
await settings.saveInstanceUrl(value!);
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
labelText: "user-id".i18n(),
|
||||
hintText: "user-id-example".i18n(),
|
||||
icon: const Icon(Icons.person),
|
||||
prefixText: "@",
|
||||
labelText: "instance-url".i18n(),
|
||||
hintText: "instance-url-example".i18n(),
|
||||
icon: const Icon(Icons.home),
|
||||
prefixText: "https://",
|
||||
),
|
||||
autofocus: true,
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || !isValidUsername(name: value)) {
|
||||
return "user-id-not-valid".i18n();
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
TextButton.icon(
|
||||
onPressed: () {
|
||||
|
@ -76,8 +66,7 @@ class _LoginFormState extends State<LoginForm> {
|
|||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const AuthPage(baseurl: "kittycat.homes"),
|
||||
builder: (context) => const AuthPage(),
|
||||
));
|
||||
}
|
||||
},
|
||||
|
@ -93,7 +82,7 @@ class _LoginFormState extends State<LoginForm> {
|
|||
page that handles authenticating user
|
||||
*/
|
||||
class AuthPage extends StatefulWidget {
|
||||
const AuthPage({Key? key, required String baseurl}) : super(key: key);
|
||||
const AuthPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AuthPage> createState() => _AuthPageState();
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:slothmu/partials/post.dart';
|
||||
import 'package:slothmu/partials/thread.dart';
|
||||
|
||||
Widget timeline(context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
children: [],
|
||||
));
|
||||
return Container(
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(24, 0, 24, 64),
|
||||
addAutomaticKeepAlives: false,
|
||||
children: [Thread(), Thread(), Thread()],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue