Search
 
SCRIPT & CODE EXAMPLE
 

DART

skeleton container flutter

import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';

class SkeletonContainer extends StatelessWidget {
  final double? width;
  final double? height;
  final ShapeBorder shapeBorder;
  
  const SkeletonContainer({
    Key? key,
    this.width,
    this.height,
    required this.shapeBorder,
  }) : super(key: key);
  
  const SkeletonContainer.rectangular(
      {this.width,
      required this.height,
      this.shapeBorder = const RoundedRectangleBorder(),
      Key? key})
      : super(key: key);

  const SkeletonContainer.circular(
      {this.width,
      required this.height,
      this.shapeBorder = const CircleBorder(),
      Key? key})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Shimmer.fromColors(
      baseColor: Colors.deepPurple[300]!,
      highlightColor: Colors.grey[300]!,
      period: const Duration(milliseconds: 2000),
      child: Container(
        width: width,
        height: height,
        decoration:
            ShapeDecoration(color: Colors.deepPurple[200]!, shape: shapeBorder),
      ),
    );
  }
}
Comment

PREVIOUS NEXT
Code Example
Dart :: change notifier flutter example 
Dart :: dart list of objects to json 
Dart :: how to get real time data flutter 
Dart :: flutter get child widget size 
Dart :: dart set final variable in constructor 
Dart :: how to use wrap widget in flutter 
Dart :: bubble sort dart 
Dart :: flutter firebase get provider type 
Dart :: floting action button tooltip 
Dart :: flutter cachImage 
Dart :: flutter provider difference between Consumer<T and context.watch<T 
Dart :: nullable conditional assignment dart 
Dart :: how to check if val only spaces in dart 
Dart :: get value from map with key flutter 
Dart :: how to stop listening to location change listener on dispose in flutter 
Dart :: dart list join 
Dart :: how to craete function in flutter 
Swift :: random string swift 
Swift :: swift notifications mac 
Swift :: swift remove space from string 
Swift :: swift uicollectionviewcell how to know when off screen 
Swift :: quartzcore framework pi chart 
Swift :: swift set uiimage color 
Swift :: swiftui vstack alignment 
Swift :: add top corner radius swift 
Swift :: deselect cell swift 
Swift :: set image from asset ios swift 
Swift :: how to change the color of back button navbar xcodee 
Swift :: enviroment dissmiss swiftui 
Swift :: swift pretty print json 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =