Add base interactive layout "rive" whit animation
This commit is contained in:
39
motula_translate_app/lib/model/course.dart
Normal file
39
motula_translate_app/lib/model/course.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart' show Color;
|
||||
|
||||
class Course {
|
||||
final String title, description, iconSrc;
|
||||
final Color color;
|
||||
|
||||
Course({
|
||||
required this.title,
|
||||
this.description = 'Build and animate an iOS app from scratch',
|
||||
this.iconSrc = "assets/icons/ios.svg",
|
||||
this.color = const Color(0xFF7553F6),
|
||||
});
|
||||
}
|
||||
|
||||
final List<Course> courses = [
|
||||
Course(
|
||||
title: "Animations in SwiftUI",
|
||||
),
|
||||
Course(
|
||||
title: "Animations in Flutter",
|
||||
iconSrc: "assets/icons/code.svg",
|
||||
color: const Color(0xFF80A4FF),
|
||||
),
|
||||
];
|
||||
|
||||
final List<Course> recentCourses = [
|
||||
Course(title: "State Machine"),
|
||||
Course(
|
||||
title: "Animated Menu",
|
||||
color: const Color(0xFF9CC5FF),
|
||||
iconSrc: "assets/icons/code.svg",
|
||||
),
|
||||
Course(title: "Flutter with Rive"),
|
||||
Course(
|
||||
title: "Animated Menu",
|
||||
color: const Color(0xFF9CC5FF),
|
||||
iconSrc: "assets/icons/code.svg",
|
||||
),
|
||||
];
|
||||
93
motula_translate_app/lib/model/menu.dart
Normal file
93
motula_translate_app/lib/model/menu.dart
Normal file
@@ -0,0 +1,93 @@
|
||||
import 'rive_model.dart';
|
||||
|
||||
class Menu {
|
||||
final String title;
|
||||
final RiveModel rive;
|
||||
|
||||
Menu({required this.title, required this.rive});
|
||||
}
|
||||
|
||||
List<Menu> sidebarMenus = [
|
||||
Menu(
|
||||
title: "Home",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "HOME",
|
||||
stateMachineName: "HOME_interactivity"),
|
||||
),
|
||||
Menu(
|
||||
title: "Search",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "SEARCH",
|
||||
stateMachineName: "SEARCH_Interactivity"),
|
||||
),
|
||||
Menu(
|
||||
title: "Favorites",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "LIKE/STAR",
|
||||
stateMachineName: "STAR_Interactivity"),
|
||||
),
|
||||
Menu(
|
||||
title: "Help",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "CHAT",
|
||||
stateMachineName: "CHAT_Interactivity"),
|
||||
),
|
||||
];
|
||||
List<Menu> sidebarMenus2 = [
|
||||
Menu(
|
||||
title: "History",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "TIMER",
|
||||
stateMachineName: "TIMER_Interactivity"),
|
||||
),
|
||||
Menu(
|
||||
title: "Notifications",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "BELL",
|
||||
stateMachineName: "BELL_Interactivity"),
|
||||
),
|
||||
];
|
||||
|
||||
List<Menu> bottomNavItems = [
|
||||
Menu(
|
||||
title: "Chat",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "CHAT",
|
||||
stateMachineName: "CHAT_Interactivity"),
|
||||
),
|
||||
Menu(
|
||||
title: "Search",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "SEARCH",
|
||||
stateMachineName: "SEARCH_Interactivity"),
|
||||
),
|
||||
Menu(
|
||||
title: "Timer",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "TIMER",
|
||||
stateMachineName: "TIMER_Interactivity"),
|
||||
),
|
||||
Menu(
|
||||
title: "Notification",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "BELL",
|
||||
stateMachineName: "BELL_Interactivity"),
|
||||
),
|
||||
Menu(
|
||||
title: "Profile",
|
||||
rive: RiveModel(
|
||||
src: "assets/RiveAssets/icons.riv",
|
||||
artboard: "USER",
|
||||
stateMachineName: "USER_Interactivity"),
|
||||
),
|
||||
];
|
||||
17
motula_translate_app/lib/model/rive_model.dart
Normal file
17
motula_translate_app/lib/model/rive_model.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:rive/rive.dart';
|
||||
|
||||
class RiveModel {
|
||||
final String src, artboard, stateMachineName;
|
||||
late SMIBool? status;
|
||||
|
||||
RiveModel({
|
||||
required this.src,
|
||||
required this.artboard,
|
||||
required this.stateMachineName,
|
||||
this.status,
|
||||
});
|
||||
|
||||
set setStatus(SMIBool state) {
|
||||
status = state;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user