feat : some changes
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:logger/logger.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/data/services/network_status.dart';
|
||||
import 'package:rasadyar_core/infrastructure/local/hive_local_storage.dart';
|
||||
|
||||
final diCore = GetIt.instance;
|
||||
|
||||
|
||||
55
packages/core/lib/presentation/widget/marquee/r_marquee.dart
Normal file
55
packages/core/lib/presentation/widget/marquee/r_marquee.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class RMarquee extends StatefulWidget {
|
||||
const RMarquee({super.key, required this.text, this.duration = const Duration(seconds: 5)});
|
||||
|
||||
final String text;
|
||||
final Duration duration;
|
||||
|
||||
@override
|
||||
State<RMarquee> createState() => _RMarqueeState();
|
||||
}
|
||||
|
||||
class _RMarqueeState extends State<RMarquee> with SingleTickerProviderStateMixin {
|
||||
late ScrollController _scrollController;
|
||||
late double _textWidth;
|
||||
late double _screenWidth;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_scrollController = ScrollController();
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_startScrolling();
|
||||
});
|
||||
}
|
||||
|
||||
void _startScrolling() async {
|
||||
while (true) {
|
||||
await _scrollController.animateTo(
|
||||
_scrollController.position.maxScrollExtent,
|
||||
duration: widget.duration,
|
||||
curve: Curves.linear,
|
||||
);
|
||||
|
||||
await _scrollController.animateTo(0, duration: Duration(seconds: 0), curve: Curves.linear);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 40,
|
||||
child: ListView(
|
||||
controller: _scrollController,
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: [
|
||||
Text(widget.text, style: AppFonts.yekan16Bold),
|
||||
SizedBox(width: 50),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,9 @@ export 'list_item/list_item_with_out_number.dart';
|
||||
export 'list_row_item.dart';
|
||||
export 'list_view/list_view.dart';
|
||||
export 'loading_widget.dart';
|
||||
// other
|
||||
export 'logo_widget.dart';
|
||||
export 'marquee/r_marquee.dart';
|
||||
export 'overlay_dropdown_widget/view.dart';
|
||||
export 'pagination/pagination_from_until.dart';
|
||||
export 'pagination/show_more.dart';
|
||||
@@ -29,6 +32,3 @@ export 'tabs/new_tab.dart';
|
||||
export 'tabs/r_segment.dart';
|
||||
export 'tabs/tab.dart';
|
||||
export 'vec_widget.dart';
|
||||
|
||||
// other
|
||||
export 'logo_widget.dart';
|
||||
|
||||
Reference in New Issue
Block a user