-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcreator_details.dart
66 lines (59 loc) · 1.59 KB
/
creator_details.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import 'dart:async';
import 'package:easy_rich_text/easy_rich_text.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class AuthorInfo extends StatefulWidget {
@override
_AuthorInfoState createState() => _AuthorInfoState();
}
class _AuthorInfoState extends State<AuthorInfo> {
final String mail = " @yeasinsheikh50";
int _charIndex = 1;
late Timer _timer;
@override
void initState() {
super.initState();
_timer = Timer.periodic(Duration(milliseconds: 100), (timer) {
setState(() {
_charIndex += 1;
if (_charIndex >= mail.length) _charIndex = 1;
});
});
}
@override
void dispose() {
_timer.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
double _bodyFS = Theme.of(context).textTheme.bodyText1!.fontSize! * 1.2;
final _textStyle = GoogleFonts.lato(
fontSize: _bodyFS,
letterSpacing: 1.3,
color: Colors.black,
);
return Container(
child: Row(
children: [
EasyRichText(
mail,
defaultStyle: _textStyle,
patternList: [
EasyRichTextPattern(
targetString: mail[_charIndex],
matchWordBoundaries: false,
hasSpecialCharacters: true,
stringBeforeTarget: mail[_charIndex - 1],
style: _textStyle.copyWith(
fontSize: _bodyFS * 1.1,
color: Color.fromRGBO(97, 70, 244, 1),
),
),
],
)
],
),
);
}
}