mirror of
				https://gitlab.com/famedly/fluffychat.git
				synced 2025-11-03 22:07:23 +01:00 
			
		
		
		
	chore: Remove gradient and add login wallpaper
This commit is contained in:
		
							parent
							
								
									57a7eb8d11
								
							
						
					
					
						commit
						c336bd8b21
					
				
							
								
								
									
										
											BIN
										
									
								
								assets/login_wallpaper.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/login_wallpaper.jpg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 211 KiB  | 
@ -2,7 +2,6 @@ import 'dart:ui';
 | 
			
		||||
 | 
			
		||||
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
 | 
			
		||||
import 'package:fluffychat/config/app_config.dart';
 | 
			
		||||
import 'package:fluffychat/widgets/background_gradient_box.dart';
 | 
			
		||||
import 'package:matrix/matrix.dart';
 | 
			
		||||
import 'package:fluffychat/pages/chat.dart';
 | 
			
		||||
import 'package:fluffychat/widgets/avatar.dart';
 | 
			
		||||
@ -205,7 +204,6 @@ class ChatView extends StatelessWidget {
 | 
			
		||||
              : null,
 | 
			
		||||
          body: Stack(
 | 
			
		||||
            children: <Widget>[
 | 
			
		||||
              BackgroundGradientBox(),
 | 
			
		||||
              if (Matrix.of(context).wallpaper != null)
 | 
			
		||||
                Image.file(
 | 
			
		||||
                  Matrix.of(context).wallpaper,
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,5 @@
 | 
			
		||||
import 'dart:math';
 | 
			
		||||
 | 
			
		||||
import 'package:fluffychat/widgets/background_gradient_box.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
class EmptyPage extends StatelessWidget {
 | 
			
		||||
@ -11,31 +10,26 @@ class EmptyPage extends StatelessWidget {
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    final _width = min(MediaQuery.of(context).size.width, EmptyPage._width);
 | 
			
		||||
    return Scaffold(
 | 
			
		||||
      body: Stack(
 | 
			
		||||
      body: Column(
 | 
			
		||||
        mainAxisAlignment: MainAxisAlignment.center,
 | 
			
		||||
        children: [
 | 
			
		||||
          BackgroundGradientBox(),
 | 
			
		||||
          Column(
 | 
			
		||||
            mainAxisAlignment: MainAxisAlignment.center,
 | 
			
		||||
            children: [
 | 
			
		||||
              Center(
 | 
			
		||||
                child: Hero(
 | 
			
		||||
                  tag: 'info-logo',
 | 
			
		||||
                  child: Image.asset(
 | 
			
		||||
                    'assets/info-logo.png',
 | 
			
		||||
                    width: _width,
 | 
			
		||||
                    height: _width,
 | 
			
		||||
                  ),
 | 
			
		||||
                ),
 | 
			
		||||
          Center(
 | 
			
		||||
            child: Hero(
 | 
			
		||||
              tag: 'info-logo',
 | 
			
		||||
              child: Image.asset(
 | 
			
		||||
                'assets/info-logo.png',
 | 
			
		||||
                width: _width,
 | 
			
		||||
                height: _width,
 | 
			
		||||
              ),
 | 
			
		||||
              if (loading)
 | 
			
		||||
                Center(
 | 
			
		||||
                  child: SizedBox(
 | 
			
		||||
                    width: _width,
 | 
			
		||||
                    child: LinearProgressIndicator(),
 | 
			
		||||
                  ),
 | 
			
		||||
                ),
 | 
			
		||||
            ],
 | 
			
		||||
            ),
 | 
			
		||||
          ),
 | 
			
		||||
          if (loading)
 | 
			
		||||
            Center(
 | 
			
		||||
              child: SizedBox(
 | 
			
		||||
                width: _width,
 | 
			
		||||
                child: LinearProgressIndicator(),
 | 
			
		||||
              ),
 | 
			
		||||
            ),
 | 
			
		||||
        ],
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
@ -1,27 +0,0 @@
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
class BackgroundGradientBox extends StatelessWidget {
 | 
			
		||||
  final Widget child;
 | 
			
		||||
  const BackgroundGradientBox({
 | 
			
		||||
    Key key,
 | 
			
		||||
    this.child,
 | 
			
		||||
  }) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return Container(
 | 
			
		||||
      decoration: BoxDecoration(
 | 
			
		||||
        gradient: LinearGradient(
 | 
			
		||||
          begin: Alignment.topRight,
 | 
			
		||||
          end: Alignment.bottomLeft,
 | 
			
		||||
          colors: [
 | 
			
		||||
            Theme.of(context).scaffoldBackgroundColor,
 | 
			
		||||
            Theme.of(context).secondaryHeaderColor.withAlpha(150),
 | 
			
		||||
            Theme.of(context).secondaryHeaderColor,
 | 
			
		||||
          ],
 | 
			
		||||
        ),
 | 
			
		||||
      ),
 | 
			
		||||
      child: child,
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -54,7 +54,7 @@ class Message extends StatelessWidget {
 | 
			
		||||
    final client = Matrix.of(context).client;
 | 
			
		||||
    final ownMessage = event.senderId == client.userID;
 | 
			
		||||
    final alignment = ownMessage ? Alignment.topRight : Alignment.topLeft;
 | 
			
		||||
    var color = Theme.of(context).scaffoldBackgroundColor;
 | 
			
		||||
    var color = Theme.of(context).secondaryHeaderColor;
 | 
			
		||||
    final sameSender = nextEvent != null &&
 | 
			
		||||
            [EventTypes.Message, EventTypes.Sticker].contains(nextEvent.type)
 | 
			
		||||
        ? nextEvent.sender.id == event.sender.id
 | 
			
		||||
 | 
			
		||||
@ -30,7 +30,7 @@ class StateMessage extends StatelessWidget {
 | 
			
		||||
            padding: const EdgeInsets.all(8),
 | 
			
		||||
            decoration: BoxDecoration(
 | 
			
		||||
              border: Border.all(
 | 
			
		||||
                color: Theme.of(context).secondaryHeaderColor,
 | 
			
		||||
                color: Theme.of(context).dividerColor,
 | 
			
		||||
              ),
 | 
			
		||||
              color: Theme.of(context).scaffoldBackgroundColor,
 | 
			
		||||
              borderRadius: BorderRadius.circular(AppConfig.borderRadius),
 | 
			
		||||
 | 
			
		||||
@ -3,8 +3,6 @@ import 'dart:math';
 | 
			
		||||
import 'package:fluffychat/config/themes.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
import '../background_gradient_box.dart';
 | 
			
		||||
 | 
			
		||||
class OnePageCard extends StatelessWidget {
 | 
			
		||||
  final Widget child;
 | 
			
		||||
 | 
			
		||||
@ -16,19 +14,22 @@ class OnePageCard extends StatelessWidget {
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return MediaQuery.of(context).size.width <= breakpoint
 | 
			
		||||
        ? child
 | 
			
		||||
        : Material(
 | 
			
		||||
            color: Theme.of(context).backgroundColor,
 | 
			
		||||
            child: BackgroundGradientBox(
 | 
			
		||||
              child: Padding(
 | 
			
		||||
                padding: EdgeInsets.symmetric(
 | 
			
		||||
                  horizontal:
 | 
			
		||||
                      max((MediaQuery.of(context).size.width - 600) / 2, 12),
 | 
			
		||||
                  vertical:
 | 
			
		||||
                      max((MediaQuery.of(context).size.height - 800) / 2, 12),
 | 
			
		||||
                ),
 | 
			
		||||
                child: SafeArea(child: Card(elevation: 3, child: child)),
 | 
			
		||||
        : Container(
 | 
			
		||||
            decoration: BoxDecoration(
 | 
			
		||||
              image: DecorationImage(
 | 
			
		||||
                image: AssetImage('assets/login_wallpaper.jpg'),
 | 
			
		||||
                fit: BoxFit.cover,
 | 
			
		||||
              ),
 | 
			
		||||
            ),
 | 
			
		||||
            child: Padding(
 | 
			
		||||
              padding: EdgeInsets.symmetric(
 | 
			
		||||
                horizontal:
 | 
			
		||||
                    max((MediaQuery.of(context).size.width - 600) / 2, 24),
 | 
			
		||||
                vertical:
 | 
			
		||||
                    max((MediaQuery.of(context).size.height - 800) / 2, 24),
 | 
			
		||||
              ),
 | 
			
		||||
              child: SafeArea(child: Card(elevation: 5, child: child)),
 | 
			
		||||
            ),
 | 
			
		||||
          );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user