1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Flutter Chat window aligning layout

Discussão em 'Mobile' iniciado por Stack, Novembro 6, 2024 às 09:32.

  1. Stack

    Stack Membro Participativo

    I need some help on aligning my flutter app chat window design layout

    The problem I have the input message box is in center instead of being on bottom down.

    I want the input message box to be down on bottom like WhatsApp APP

    Below is my script

    I appreciate for any help Thanks

    this is my full script am using visual studio

    import 'package:flutter/material.dart';

    void main() {
    runApp(const MyApp());
    }

    class MyApp extends StatelessWidget {
    const MyApp({super.key});

    @override
    Widget build(BuildContext context) {
    return MaterialApp(
    debugShowCheckedModeBanner: false,
    title: 'Chat',
    theme: ThemeData(
    scaffoldBackgroundColor: Colors.black,
    ),
    home: Scaffold(
    appBar: AppBar(
    title: const Text("Some url"),
    actions: <Widget>[
    //IconButton
    IconButton(
    icon: const Icon(Icons.logout_rounded),
    onPressed: () {},
    ), //IconButton
    ], //<Widget>[]
    backgroundColor: Colors.greenAccent[400],
    elevation: 50.0,
    leading: IconButton(
    icon: const Icon(Icons.link_outlined),
    onPressed: () {},
    ),
    ), //AppBar
    body: Center(
    child: Padding(
    padding: EdgeInsets.only(
    bottom: MediaQuery.of(context).viewInsets.bottom),
    child: Container(
    height: 45,
    width: MediaQuery.of(context).size.width,
    color: Colors.black,
    child: Row(
    children: [
    Expanded(
    child: TextField(
    cursorColor: Colors.white70,
    style: const TextStyle(color: Colors.white70),
    decoration: InputDecoration(
    border: OutlineInputBorder(
    borderRadius: BorderRadius.circular(20.0),
    borderSide:
    const BorderSide(color: Colors.black, width: 2.0),
    ),
    enabledBorder: OutlineInputBorder(
    borderRadius: BorderRadius.circular(20.0),
    borderSide:
    const BorderSide(color: Colors.black, width: 2.0),
    ),
    focusedBorder: OutlineInputBorder(
    borderRadius: BorderRadius.circular(20.0),
    borderSide:
    const BorderSide(color: Colors.black, width: 2.0),
    ),
    filled: true,
    fillColor: const Color.fromARGB(255, 27, 29, 35),
    hintText: 'Message',
    hintStyle: const TextStyle(
    color: Colors.white24,
    ),
    ),
    ),
    ),
    SizedBox(
    width: 15,
    ),
    // Send Button
    MaterialButton(
    color: Colors.white70,
    onPressed: () {},
    child: Icon(
    Icons.send,
    color: Colors.black,
    size: 15,
    ),
    shape: CircleBorder(),
    padding: EdgeInsets.all(24),
    ),
    ],
    ),
    ),
    ),
    ),
    ),
    );
    }
    }

    Continue reading...

Compartilhe esta Página