aagarwal1012 / Animated-Text-Kit

🔔 A flutter package to create cool and beautiful text animations. [Flutter Favorite Package]
https://animated-text-kit.web.app
MIT License
1.67k stars 307 forks source link

please could you add Arabic character support #257

Open ibra7002 opened 3 years ago

ibra7002 commented 3 years ago

please could you add Arabic character support

SirusCodes commented 3 years ago

Hey, @ibra7002 which animations are not supported?

ibra7002 commented 3 years ago

Thanks for your reply, its wavy

On Sun, 13 Jun 2021, 9:02 pm Darshan Rander, @.***> wrote:

Hey, @ibra7002 https://github.com/ibra7002 which animations are not supported?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aagarwal1012/Animated-Text-Kit/issues/257#issuecomment-860255743, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUOYJXFWFR5LVLMXHQ3YID3TST6ENANCNFSM46TPBTNA .

SirusCodes commented 3 years ago

Can you send us reproduceable code along with an example video and error log if any.

ibra7002 commented 3 years ago

thanks for replying , sorry for being late

import 'package:flutter/material.dart';
import 'package:flutter/material.dart';
import 'package:animated_text_kit/animated_text_kit.dart';

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
        DefaultTextStyle(
        style: const TextStyle(
          fontSize: 20.0,
        ),
        child: AnimatedTextKit(
          animatedTexts: [
            WavyAnimatedText('Hello World'),
            WavyAnimatedText('Look at the waves'),
          ],
          isRepeatingAnimation: true,
          onTap: () {
            print("Tap Event");
          },
        ),
      ),

            AnimatedTextKit(
              animatedTexts: [
                WavyAnimatedText('Hello World'),
                WavyAnimatedText('برنامج القانونيه'),
              ],
              isRepeatingAnimation: true,
              onTap: () {
                print("Tap Event");
              },
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

class test extends StatefulWidget {

  test({Key key, this.title}) : super(key: key);
  final String title;
  @override
  _testState createState() => _testState();
}

class _testState extends State<test> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: DefaultTextStyle(
        style: const TextStyle(
          fontSize: 20.0,
        ),
        child: AnimatedTextKit(
          animatedTexts: [
            WavyAnimatedText('برنامج القانونيه'),
            WavyAnimatedText('Look at the waves'),
          ],
          isRepeatingAnimation: true,
          onTap: () {
            print("Tap Event");
          },
        ),
      ),
    );
  }
}

https://user-images.githubusercontent.com/85820636/122424111-bee64600-cf8e-11eb-94db-d39cb9a07187.mov

as you can see in video the Arabic word split and its animation failed to get the desired effect

SirusCodes commented 3 years ago

Thanks for bringing this to our attention. So how wavy works is it splits your texts into characters and then animate each renders each character independently. It would be great if you can help us find a way how we can support this package with Arabic font as it would help other languages as well.

ibra7002 commented 3 years ago

Thanks so much for your response, wavy works well in English,french,etc... because Words have character with spaces between them , but in Arabic not all words have spaces , so you can not split connected character,maybe you can split the Unconnected characters and maybe the connected can move together, just a thought . Thanks again so much for follow up and response

SirusCodes commented 3 years ago

Yes! Devanagari also has a similar way of writing. Do you have any idea how we can split them?

ibra7002 commented 3 years ago

No, I don't.

On Fri, Jun 18, 2021 at 3:10 AM Darshan Rander @.***> wrote:

Yes! Devanagari https://en.wikipedia.org/wiki/Devanagari also has a similar way of writing. Do you have any idea how we can split them?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/aagarwal1012/Animated-Text-Kit/issues/257#issuecomment-863659286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUOYJXDFEDYQLBCEINH654LTTKMJ5ANCNFSM46TPBTNA .

ibra7002 commented 3 years ago

no i do not sorry

validity-check commented 3 years ago

What about some sort of joining character like "Ù€"

SirusCodes commented 3 years ago

What about some sort of joining character like "Ù€"

That's a really nice idea. We can also allow the user to have their own delimiter. Would be great if you can contribute to it.