newsfeed_vm.dart 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import 'package:flutter/material.dart';
  2. import 'package:riverpod_annotation/riverpod_annotation.dart';
  3. import 'package:shared/utils/color_utils.dart';
  4. import 'newsfeed_state.dart';
  5. part 'newsfeed_vm.g.dart';
  6. @riverpod
  7. class NewsfeedVm extends _$NewsfeedVm {
  8. NewsfeedState initState() {
  9. return NewsfeedState(
  10. activeIndex: 0,
  11. tabsList: [
  12. {
  13. 'title': 'News',
  14. 'icon': null,
  15. 'activeTitleColor': Colors.white,
  16. 'activeTitleFontSize': 16,
  17. 'activeTitleBackgroundColor': ColorUtils.string2Color("#4161D0"),
  18. },
  19. {
  20. 'title': 'Following',
  21. 'icon': null,
  22. 'activeTitleColor': Colors.white,
  23. 'activeTitleFontSize': 16,
  24. 'activeTitleBackgroundColor': ColorUtils.string2Color("#4161D0"),
  25. },
  26. {
  27. 'title': 'For You',
  28. 'icon': null,
  29. 'activeTitleColor': Colors.white,
  30. 'activeTitleFontSize': 16,
  31. 'activeTitleBackgroundColor': ColorUtils.string2Color("#4161D0"),
  32. }
  33. ]
  34. );
  35. }
  36. @override
  37. NewsfeedState build(){
  38. NewsfeedState state = initState();
  39. return state;
  40. }
  41. }