getTabUiTemplate function

String getTabUiTemplate({
  1. String? className,
  2. String? isLoading,
})

Implementation

String getTabUiTemplate({String? className, String? isLoading}) {
  final body = '''DefaultTabController(
      length: 3,
      child: Column(
        children: [
          Container(
            color: Colors.white,
            child: const TabBar(
              labelColor: Colors.blue,
              unselectedLabelColor: Colors.grey,
              indicatorColor: Colors.blue,
              tabs: [
                Tab(child: TextWidget(text: "OVERVIEW", fontWeight: FontWeight.bold, textSize: 12)),
                Tab(child: TextWidget(text: "DETAILS", fontWeight: FontWeight.bold, textSize: 12)),
                Tab(child: TextWidget(text: "SETTINGS", fontWeight: FontWeight.bold, textSize: 12)),
              ],
            ),
          ),
          const Expanded(
            child: TabBarView(
              children: [
                Center(child: TextWidget(text: "Overview content goes here", color: Colors.grey)),
                Center(child: TextWidget(text: "Detailed information here", color: Colors.grey)),
                Center(child: TextWidget(text: "Settings management here", color: Colors.grey)),
              ],
            ),
          ),
        ],
      ),
    )''';

  if (className != null) {
    return '''CustomBody(
      title: "$className",
      isLoading: ${isLoading ?? 'false'},
      appBarLeading: const BackButton(),
      child: $body
    )''';
  }
  return body;
}