mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 14:32:37 +01:00
refactor: border radius
This commit is contained in:
parent
ea1bb89025
commit
ddd10d189d
@ -41,6 +41,8 @@ abstract class AppConfig {
|
||||
static const String emojiFontName = 'Noto Emoji';
|
||||
static const String emojiFontUrl =
|
||||
'https://github.com/googlefonts/noto-emoji/';
|
||||
static const double borderRadius = 12.0;
|
||||
static const double messageBubbleBorderRadius = 16.0;
|
||||
|
||||
static void loadFromJson(Map<String, dynamic> json) {
|
||||
if (json['application_name'] is String) {
|
||||
|
@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../app_config.dart';
|
||||
|
||||
class DefaultAppBarSearchField extends StatefulWidget {
|
||||
final TextEditingController searchController;
|
||||
final void Function(String) onChanged;
|
||||
@ -81,7 +83,7 @@ class DefaultAppBarSearchFieldState extends State<DefaultAppBarSearchField> {
|
||||
decoration: InputDecoration(
|
||||
prefixText: widget.prefixText,
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
borderSide:
|
||||
BorderSide(color: Theme.of(context).secondaryHeaderColor),
|
||||
),
|
||||
|
@ -76,8 +76,6 @@ class Message extends StatelessWidget {
|
||||
: Theme.of(context).primaryColor;
|
||||
}
|
||||
|
||||
final radius = 16.0;
|
||||
|
||||
var rowChildren = <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
@ -87,7 +85,8 @@ class Message extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
borderRadius:
|
||||
BorderRadius.circular(AppConfig.messageBubbleBorderRadius),
|
||||
),
|
||||
constraints:
|
||||
BoxConstraints(maxWidth: FluffyThemes.columnWidth * 1.5),
|
||||
|
@ -42,12 +42,12 @@ abstract class FluffyThemes {
|
||||
),
|
||||
dialogTheme: DialogTheme(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
),
|
||||
popupMenuTheme: PopupMenuThemeData(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
),
|
||||
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
||||
@ -55,9 +55,10 @@ abstract class FluffyThemes {
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius)),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
borderSide: BorderSide(
|
||||
color: AppConfig.primaryColor.withAlpha(16),
|
||||
),
|
||||
@ -90,12 +91,12 @@ abstract class FluffyThemes {
|
||||
textTheme: Typography.material2018().white.merge(fallback_text_theme),
|
||||
dialogTheme: DialogTheme(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
),
|
||||
popupMenuTheme: PopupMenuThemeData(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
),
|
||||
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
||||
@ -103,11 +104,12 @@ abstract class FluffyThemes {
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius)),
|
||||
filled: true,
|
||||
fillColor: AppConfig.primaryColorLight.withAlpha(32),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
borderSide: BorderSide(
|
||||
color: AppConfig.primaryColor.withAlpha(16),
|
||||
),
|
||||
|
@ -7,6 +7,7 @@ import 'package:fluffychat/components/list_items/contact_list_tile.dart';
|
||||
import 'package:fluffychat/components/matrix.dart';
|
||||
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../app_config.dart';
|
||||
import '../../utils/client_presence_extension.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
@ -96,7 +97,8 @@ class _ContactListState extends State<ContactList> {
|
||||
elevation: 7,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius:
|
||||
BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
@ -172,7 +172,7 @@ class _HomeserverPickerState extends State<HomeserverPicker> {
|
||||
elevation: 7,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: _isLoading
|
||||
? LinearProgressIndicator()
|
||||
|
@ -9,6 +9,8 @@ import 'package:flushbar/flushbar_helper.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
import '../app_config.dart';
|
||||
|
||||
class Login extends StatefulWidget {
|
||||
@override
|
||||
_LoginState createState() => _LoginState();
|
||||
@ -222,7 +224,7 @@ class _LoginState extends State<Login> {
|
||||
elevation: 7,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: loading
|
||||
? LinearProgressIndicator()
|
||||
|
@ -9,6 +9,8 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
import '../app_config.dart';
|
||||
|
||||
class SignUp extends StatefulWidget {
|
||||
@override
|
||||
_SignUpState createState() => _SignUpState();
|
||||
@ -143,7 +145,7 @@ class _SignUpState extends State<SignUp> {
|
||||
elevation: 7,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: loading
|
||||
? LinearProgressIndicator()
|
||||
|
@ -9,6 +9,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../app_config.dart';
|
||||
|
||||
class SignUpPassword extends StatefulWidget {
|
||||
final MatrixFile avatar;
|
||||
final String username;
|
||||
@ -176,7 +178,7 @@ class _SignUpPasswordState extends State<SignUpPassword> {
|
||||
elevation: 7,
|
||||
color: Theme.of(context).primaryColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
),
|
||||
child: loading
|
||||
? LinearProgressIndicator()
|
||||
|
Loading…
Reference in New Issue
Block a user