Giter Site home page Giter Site logo

Comments (10)

leeyisoft avatar leeyisoft commented on May 30, 2024 2

@eyoeldefare @leeyisoft @Govindbetterlives It's not required by Package, it can be achieved by the user: Please See the Added Example PR #77

Thanks very much to the eyoeldefare/textfield_tags library and your @hardiklakhalani demo #77 , I have implemented the function of line wrapping

Here is the key code:

scrollDirection: Axis.vertical,


                            prefixIconConstraints: BoxConstraints(
                                maxWidth: state.distanceToField * 1.0),
                            prefixIcon: tags.isEmpty
                                ? null
                                : SingleChildScrollView(
                                    controller: scController,
                                    scrollDirection: Axis.vertical,
                                    child: Wrap(
                                      // runSpacing: 7.0,
                                      children: (tags.map((String tag) {
                                        return TagItem(

Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,

import 'package:flutter/material.dart';

///
class TagItem extends StatelessWidget {
  final String tag;
  final Function(String tag) onTagDelete;

  final Color backgroundColor;
  final Color selectedBackgroundColor;
  final Color tagSelectedColor;

  const TagItem({
    Key? key,
    required this.tag,
    required this.onTagDelete,
    this.backgroundColor = const Color(0xfff8f8f8),
    this.selectedBackgroundColor = const Color(0xFF649BEC),
    this.tagSelectedColor = const Color(0xFF649BEC),
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        borderRadius: const BorderRadius.all(
          Radius.circular(20.0),
        ),
        color: selectedBackgroundColor,
      ),
      margin: const EdgeInsets.only(right: 10.0, top: 6, bottom: 6),
      padding: const EdgeInsets.symmetric(
        horizontal: 10.0,
        vertical: 4.0,
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        mainAxisSize: MainAxisSize.min,
        children: [
          InkWell(
image

from textfield_tags.

eyoeldefare avatar eyoeldefare commented on May 30, 2024 1

Multi lines are not supported.

from textfield_tags.

zanpen2000 avatar zanpen2000 commented on May 30, 2024

same here, anybody ?

from textfield_tags.

leeyisoft avatar leeyisoft commented on May 30, 2024

There is no support for multi-line function, feel that support for multi-line user input experience will be better

from textfield_tags.

hardiklakhalani avatar hardiklakhalani commented on May 30, 2024

@eyoeldefare @leeyisoft
I'll try with my fork, if it'll work I'll add a PR.

from textfield_tags.

leeyisoft avatar leeyisoft commented on May 30, 2024

@eyoeldefare @leeyisoft I'll try with my fork, if it'll work I'll add a PR.

@hardiklakhalani I took a look at the textfield_tags source code, it is difficult for me to add support multilines functionality, looking forward to your results

from textfield_tags.

hardiklakhalani avatar hardiklakhalani commented on May 30, 2024

@eyoeldefare @leeyisoft @Govindbetterlives
It's not required by Package, it can be achieved by the user: Please See the Added Example PR #77

from textfield_tags.

leeyisoft avatar leeyisoft commented on May 30, 2024

@eyoeldefare @leeyisoft @Govindbetterlives It's not required by Package, it can be achieved by the user: Please See the Added Example PR #77

How do I position the cursor after the end?

image

from textfield_tags.

hardiklakhalani avatar hardiklakhalani commented on May 30, 2024

@leeyisoft I tried looking for solution but could not find a way. Chips as prefix widget & Textfield is not multiline that's why cursor stays in center. If we turn textfield to multiline, cursor can goes to top but that'll bring up tags with line-breaks

Let us know if you or anyone else can get through.

from textfield_tags.

leeyisoft avatar leeyisoft commented on May 30, 2024

@leeyisoft I tried looking for solution but could not find a way. Chips as prefix widget & Textfield is not multiline that's why cursor stays in center. If we turn textfield to multiline, cursor can goes to top but that'll bring up tags with line-breaks

Let us know if you or anyone else can get through.

Okay, I found a way back here to share

from textfield_tags.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.