Skip to content

Commit

Permalink
Merge branch 'main' into asim/app-theme-text-styles-#258
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshub024 authored Feb 29, 2024
2 parents d8ccafa + d5f7907 commit cbd698c
Show file tree
Hide file tree
Showing 23 changed files with 1,477 additions and 141 deletions.
127 changes: 71 additions & 56 deletions examples/mirai_gallery/assets/json/bottom_nav_bar_example.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,81 @@
{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "Selected label"
}
},
"body": {
"type": "row",
"mainAxisAlignment": "center",
"crossAxisAlignment": "center",
"children": [
{
"type": "column",
"mainAxisAlignment": "center",
"crossAxisAlignment": "center",
"children": [
{
"type": "defaultBottomNavigationController",
"length": 3,
"child": {
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "Bottom Navigation Screen"
}
},
"body": {
"type": "bottomNavigationView",
"children": [
{
"type": "center",
"child": {
"type": "text",
"data": "Home",
"style": {
"fontSize": 17
"fontSize": 24
}
}
},
{
"type": "center",
"child": {
"type": "text",
"data": "Search",
"style": {
"fontSize": 24
}
}
},
{
"type": "center",
"child": {
"type": "text",
"data": "Profile",
"style": {
"fontSize": 24
}
}
]
}
]
},
"bottomNavigationBar": {
"type": "bottomNavigationBar",
"items": [
{
"type": "navigationBarItem",
"label": "Comments",
"icon": {
"type": "icon",
"iconType": "material",
"icon": "comment",
"size": 24
}
},
{
"type": "navigationBarItem",
"label": "Calendar",
"icon": {
"type": "icon",
"iconType": "material",
"icon": "calendar_month",
"size": 24
}
},
{
"type": "navigationBarItem",
"label": "Account",
"icon": {
"type": "icon",
"iconType": "cupertino",
"icon": "profile_circled",
"size": 24
]
},
"bottomNavigationBar": {
"type": "bottomNavigationBar",
"items": [
{
"type": "navigationBarItem",
"label": "Home",
"icon": {
"type": "icon",
"iconType": "material",
"icon": "home"
}
},
{
"type": "navigationBarItem",
"label": "Search",
"icon": {
"type": "icon",
"iconType": "material",
"icon": "search"
}
},
{
"type": "navigationBarItem",
"label": "Profile",
"icon": {
"type": "icon",
"iconType": "material",
"icon": "account_circle"
}
}
}
]
]
}
}
}
34 changes: 34 additions & 0 deletions examples/mirai_gallery/assets/json/home_screen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,40 @@
"assetPath": "assets/json/chip_example.json"
}
}
},
{
"type": "listTile",
"leading": {
"type": "icon",
"iconType": "material",
"icon": "wrap_text"
},
"title": {
"type": "text",
"data": "Wrap",
"align": "center",
"style": {
"fontSize": 21
}
},
"subtitle": {
"type": "text",
"data": "A widget to creates a wrap layout",
"align": "center",
"style": {
"fontSize": 12
}
},
"isThreeLine": true,
"style": "list",
"onTap": {
"actionType": "navigate",
"navigationStyle": "push",
"widgetJson": {
"type": "exampleScreen",
"assetPath": "assets/json/wrap_example.json"
}
}
}
]
}
Expand Down
180 changes: 180 additions & 0 deletions examples/mirai_gallery/assets/json/wrap_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "Wrap Demo"
}
},
"body": {
"type": "center",
"child": {
"type": "wrap",
"spacing": 8.0,
"runSpacing": 4.0,
"children": [
{
"type": "container",
"color": "#FFCDD2",
"width": 100,
"height": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "1",
"style": {
"color": "#FFFFFF"
}
}
}
},
{
"type": "container",
"color": "#F8BBD0",
"width": 100,
"height": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "2",
"style": {
"color": "#FFFFFF"
}
}
}
},
{
"type": "container",
"color": "#E1BEE7",
"width": 100,
"height": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "3",
"style": {
"color": "#FFFFFF"
}
}
}
},
{
"type": "container",
"color": "#D1C4E9",
"width": 100,
"height": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "4",
"style": {
"color": "#FFFFFF"
}
}
}
},
{
"type": "container",
"color": "#C5CAE9",
"width": 100,
"height": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "5",
"style": {
"color": "#FFFFFF"
}
}
}
},
{
"type": "container",
"color": "#BBDEFB",
"width": 100,
"height": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "6",
"style": {
"color": "#FFFFFF"
}
}
}
},
{
"type": "container",
"color": "#B3E5FC",
"width": 100,
"height": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "7",
"style": {
"color": "#FFFFFF"
}
}
}
},
{
"type": "container",
"color": "#B2EBF2",
"width": 100,
"height": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "8",
"style": {
"color": "#FFFFFF"
}
}
}
},
{
"type": "container",
"color": "#B2DFDB",
"width": 100,
"height": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "9",
"style": {
"color": "#FFFFFF"
}
}
}
},
{
"type": "container",
"color": "#C8E6C9",
"width": 100,
"height": 100,
"child": {
"type": "center",
"child": {
"type": "text",
"data": "10",
"style": {
"color": "#FFFFFF"
}
}
}
}
]
}
}
}
4 changes: 4 additions & 0 deletions packages/mirai/lib/src/framework/mirai.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:flutter/services.dart';
import 'package:mirai/src/action_parsers/action_parsers.dart';
import 'package:mirai/src/action_parsers/mirai_network_request/mirai_network_request_parser.dart';
import 'package:mirai/src/framework/mirai_registry.dart';
import 'package:mirai/src/parsers/mirai_wrap/mirai_wrap.dart';
import 'package:mirai/src/parsers/parsers.dart';
import 'package:mirai/src/services/mirai_network_service.dart';
import 'package:mirai/src/utils/log.dart';
Expand Down Expand Up @@ -65,6 +66,9 @@ class Mirai {
const MiraiCircleAvatarParser(),
const MiraiChipParser(),
const MiraiGridViewParser(),
const MiraiBottomNavigationViewParser(),
const MiraiDefaultBottomNavigationControllerParser(),
const MiraiWrapParser(),
];

static final _actionParsers = <MiraiActionParser>[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ part 'mirai_bottom_navigation_bar.g.dart';
@freezed
class MiraiBottomNavigationBar with _$MiraiBottomNavigationBar {
const factory MiraiBottomNavigationBar({
//Todo: onTap,
required List<MiraiBottomNavigationBarItem> items,
@Default(0) int currentIndex,
double? elevation,
BottomNavigationBarType? navBarType,
BottomNavigationBarType? bottomNavigationBarType,
String? fixedColor,
String? backgroundColor,
@Default(24) double iconSize,
Expand Down
Loading

0 comments on commit cbd698c

Please sign in to comment.